Looking at this div:
<!------ CODE SNIPPET ------>
<div id="content">
<div class="top">
I am cool<br />
I am cool<br />
I am cool<br />
I am cool<br />
</div>
</div>
<!------ /CODE SNIPPET ------>
Accompanied by this CSS:
#content{
height:auto;
width:100%;
background-color:#FF0000;
}
#content .top{
margin:15px 35px 35px 35px;
padding:20px;
width:inherit;
height:inherit;
position:absolute;
-moz-box-shadow: 5px 5px 10px rgba(0,0,0,.8), inset 2px 2px 2px rgba(0,0,0,.2), inset -2px -2px 3px rgba(255,255,255,.85);
-webkit-box-shadow: 5px 5px 10px rgba(0,0,0,.8), inset 2px 2px 2px rgba(0,0,0,.2), inset -2px -2px 3px rgba(255,255,255,.85);
box-shadow: 5px 5px 10px rgba(0,0,0,.8), inset 2px 2px 2px rgba(0,0,0,.2), inset -2px -2px 3px rgba(255,255,255,.85);
-moz-border-radius: 5px;
border-radius: 5px;
background-color:rgba(224,224,224,.92);
}
The intention was for the content div to span the entire browser window width while adjusting the .top div to fit inside with padding and margin. However, as experienced, instead of achieving the desired effect, the .top div extends beyond the screen horizontally due to the excessive margin, resulting in a scroll bar appearing:
It should align further left with a margin of 35, ending where the header concludes.
This explanation might not be the clearest, but I'm hopeful someone can offer guidance. This situation is quite frustrating for me!