I am using masterpages in asp.net to theme a site. When i try to view the page in Chrome/FF, the body contents start 180px down the page. I can fix it by setting the top to -180px in css but that seems wrong. I have included a screen shot of the problem. The bgcolor & img are aligned correctly, but the contents are not. I set the body height to 10px so it would be easy to see in the screencap of chromes debugger.
Here's the css I have so far:
*
{
position:relative;
margin:0;
padding:0;
border:0 none;
font-family:'trebuchet ms', sans-serif;
font-size:9pt;
}
body
{
background-color: #1EB9E9;
background-image: url('images/bg.jpg');
background-repeat: repeat-x;
background-attachment: fixed;
background-position: -95px 0px;
position: relative;
display: block;
padding: 0px;
margin: 0px;
left: auto;
right: auto;
text-align: center;
width: 100%;
}
#main
{
background: #FFFFFF url('images/contentBg.jpg') no-repeat scroll center top;
Question
aberflasm
I am using masterpages in asp.net to theme a site. When i try to view the page in Chrome/FF, the body contents start 180px down the page. I can fix it by setting the top to -180px in css but that seems wrong. I have included a screen shot of the problem. The bgcolor & img are aligned correctly, but the contents are not. I set the body height to 10px so it would be easy to see in the screencap of chromes debugger.
Here's the css I have so far:
*
{
position:relative;
margin:0;
padding:0;
border:0 none;
font-family:'trebuchet ms', sans-serif;
font-size:9pt;
}
body
{
background-color: #1EB9E9;
background-image: url('images/bg.jpg');
background-repeat: repeat-x;
background-attachment: fixed;
background-position: -95px 0px;
position: relative;
display: block;
padding: 0px;
margin: 0px;
left: auto;
right: auto;
text-align: center;
width: 100%;
}
#main
{
background: #FFFFFF url('images/contentBg.jpg') no-repeat scroll center top;
width: 713px;
height: 800px;
margin: 0 auto;
}
#content
{
margin: 180px 110px auto;
}
Anyone know the proper fix?
Link to comment
Share on other sites
4 answers to this question
Recommended Posts