Parents should not allow their children to use the internet and social media "in the same way they would use sweets or junk food", the Children's Commissioner for England has warned.

Anne Longfield said children should not be left to use their devices without "agreed boundaries" as she launched a guide to promote a positive relationship with technology.

It is hoped the campaign, Digital 5 a Day, will help with what Ms Longfield describes as "one of the modern parenting world's newest and biggest dilemmas".

In a blog post on her website, she wrote: "I don't think parents should be afraid of children's digital lives - but what they should avoid doing is allowing their children to use the internet and social media in the same way they would use sweets or junk food given half the chance.

"You wouldn't let an eight-year-old eat a double cheeseburger and fries every day of the year, so it's important children aren't left to use smart phones, computers or tablets without agreed boundaries.

"It doesn't have to be about restriction and control - which is unlikely to win over any child anyway - but something children will often love: working out together a good way to be online."

She points out the amount of time children are online is increasing, and says that very young children are routinely spending more than eight hours a week online, while 12-15-year-olds are spending more than 20 hours a week online.

The campaign suggests keeping a note of how much time is being spent online, with Ms Longfield's post saying: "We hear that children often feel pressured by the constantly connected nature of the internet.

"While they might want to do other things, it can be difficult for them to put their phones down when apps are encouraging them to engage.

"Being mindful about the amount of time that your child is spending online - and encouraging them to be mindful about how this makes them feel - is important.

"Encourage children to come up with ways of managing this i.e. keeping a diary as way of logging the amount of time they are spending online or downloading an app that helps them manage their notifications."

The Digital 5 a Day campaign is based on the NHS's five steps to better mental wellbeing.