2 replies [Last post]
Knutsford-Software
Knutsford-Software's picture
Offline
newbie
united kingdom
Last seen: 35 weeks 3 days ago
united kingdom
Joined: 2011-04-26
Posts: 2
Points: 4

body {	
	margin: auto;
	padding-bottom:5%;
	padding-left:0%;
	padding-right:0%;
	padding-top:5%;
	background-color:#FAE8B3;	 
	font-size: 16px;
	color: #FF9554;	
	font-weight:bold;
	max-width: 100%; 	
	width: auto;
}

For some reason that I can't work out the above has a horizontal scroll bar when viewing on a mobile. Can anyone see why please. Thanks

pavithraramesh
pavithraramesh's picture
Offline
newbie
Chennai
Last seen: 30 weeks 6 days ago
Chennai
Timezone: GMT+5.5
Joined: 2018-01-15
Posts: 5
Points: 5

margin and padding

Hi,

I don't see any problem in the code. Probably there is some default padding or margin of HTML.

Try adding these codes before body

* {padding:0; margin:0;}
html {padding:0; margin:0;}

Try this and please let me know if it works.

Regards,

Pavithra Ramesh
Spidergems

gary.turner
gary.turner's picture
Offline
Moderator
Dallas
Last seen: 12 hours 43 min ago
Dallas
Timezone: GMT-5
Joined: 2004-06-25
Posts: 9702
Points: 3778

First guess

Without seeing the page in totality, guessing is all we can do.

My guess is that something in the page has an intrinsic width wider than the viewport. For example, an image or a table, or any element with a too wide absolute dimension.

gary

If your web page is as clever as you can make it, it's probably too clever for you to debug or maintain.