It means that, from July next year, there will no longer be any "junk-food" ads on social media and gaming channels that are aimed at children.
The ban extends to media where children make up at least 25% of the audience.
An ASA spokesman said that advertisers would need to satisfy it that they had targeted their ads appropriately. The spokesman added; "Robust audience measurement data gives advertisers the most certainty in making targeting decisions. But the ASA can have regard to other factors such as the content and context of the ad."
Online platforms that allow targeted ads using account data must ensure they've used appropriate criteria to exclude under 16s, the spokesman added. Campaign has contacted Facebook, Google, Instagram, Twitter and Snapchat to ask how they will meet this requirement.
The restrictions only apply to HFSS products rather than all food and drink. The Committee of Advertising Practice is relaxing the rules around non-HFSS food and drink brands to allow them to use promotions, licensed characters and celebrities popular with children under 12.
The move is part of the outcome of a consultation held by the Advertising Standards Authority this summer. It is designed to bring non-broadcast media in line with broadcast media.
Shahriar Coupal, director of CAP and the Broadcast Committee of Advertising Practice, said the proposals had support from stakeholders of all kinds, including advertisers, media owners and health campaigners.
Coupal said the update was prompted by a greater knowledge of the social problems caused by obesity and the change in children’s media consumption. This meant even a "small positive impact" on children’s behaviour could make a significant difference, he said.
An Ofcom report published last month found that children aged five to 15 spend more time online (15 hours per week) than watching TV (13 hours and 36 minutes) for the first time.
Coupal added: "What’s changed is not the evidence – that shows advertising has only a modest impact on children’s behaviour. What we have now is a much greater understanding of the economic and social cost of obesity."
Ian Wright, director general of the Food and Drink Federation, welcomed the news, saying: "HFSS food and drink ads have long been banned on children's TV, with under-16s today seeing far fewer of these ads than in recent years.
"As young people move away from traditional media towards new and social media, we feel it's important that ad rules keep up with this change."
Advertising Association chief executive Stephen Woodford added that "these new rules reflect changing media habits and reinforce a regime which has already greatly reduced the advertising kids see for sugary, fatty foods.
"Regulation is important but we also know the effects of advertising are relatively small, so whether it’s supporting parents with healthier choices, improving education or getting more people, more active, let’s now grab the opportunity to put our collective energy into tackling the big drivers of obesity."
But Malcolm Clark, co-ordinator of the Children’s Food Campaign, gave the changes a lukewarm response, warning that children would continue to be exposed to some media that would not be covered.
He said: "The CAP has finally listened to the voices of parents and health professionals, after years of resisting calls for stronger measures to reduce children’s exposure to junk food marketing online. The new rules are a positive step and go some way to removing the most blatant forms of such advertising to under 16s.
"Unfortunately, the power still seems to be very much in the hands of manufacturers and advertisers, not parents. Instead of a comprehensive and transparent definition of what constitutes marketing ‘directly appealing to children’, which Children’s Food Campaign proposed, CAP will only apply the restrictions when children are over 25% of the audience.
"This figure provides insufficient protection to children, whilst giving parents little knowledge of what is and isn’t covered. Parents will also be disappointed to find out there will be no restrictions on the use of child-friendly brand characters on packaging."