tags:

views:

57

answers:

2

I have an element with width 100% of the body and i need to be able to give it padding in pixels. every attempt i had at it ended up adding scrolling. i can't use overflow:hidden because i need to have vertical scrolling, and overflow-x/y isn't fully supported yet.

so how can i add fiexed padding to an element with a 100% width?

A: 

If you give padding to body (which is 100% by default), it will increase the width of the page and add scrollbars.

You need to create a DIV within body and work in it.

Nimbuz
A: 

Try using this:

<body>
<div style="width:auto; background-color:#333333;height:100%; padding:10px; color:#FFFFFF;">
Example
</div>
</body>

I do not encourage you to use inline styling

halocursed