Reputation: 4677
The main content of my page (text and a form) move horizontally accross the page as you change the size of the browser window. My logo stays in a fixed position. I cannot find a difference in the css between the two classes that would make this happen. Here is the css:
.main {width:100%; padding:0; margin:0 auto; min-width: 1020px; overflow: hidden;}
.header { background:url(images/slider_bgpng200.png); background-repeat: repeat-x; padding:0; margin:0 auto; width: 100%; }
.headertop{width: 44%; background: #d3e5e8; height: 30px; min-width: 1020px;float: left; padding-left: 50px; margin: 0 auto;}
.block_header {margin:0 auto; width:1200px; padding:0; border:none; }
.space { float:left; padding:0; margin:0; }
.header_text { width:200px; float:right; font:normal 11px Tahoma, Geneva, sans-serif; color:#9a9a9a; padding:6px 10px 10px 10px; margin:0; text-align:center;}
.slider { background: transparent; margin:0 auto; padding:0; height:420px;}
.slider .gallery { margin:0 auto; width:980px; height:420px; padding:0;}
.slider .textholder {padding-top: 110px; float: left; width: 44%; font-family: 'Roboto', sans-serif; font-size: 40px; color: #93a0a2;padding-left: 30px;}
.formbox{float: right; width: 48%; padding-top: 90px; padding-right: 40px;}
And here is the html:
<div class="main">
<div class="header">
<div class="headertop"> <img src="images/avidestlogo50perresave.png" border="0" alt="logo" />
<div class="header_text"><a href="#">Email</a> | <a href="#">Client Login</a>
</div>
</div>
<div class="block_header">
<div class="space"><a href="index.html"></a>
</div>
</div>
<div class="slider">
<div class="gallery">
<div class="textholder">
Where Student and <br />
Alumni Freelancers <br /> Get Hired
</div>
<div class = "formbox">Form is here
</div>
</div>
</div>
</div>
</div>
</div>
The site is up at avidest.com/schneer so you can see what I am talking about. Thanks for your help.
Upvotes: 0
Views: 316
Reputation: 63471
You have width:100%
in your .header
class.
This is not the same as width:1200px
in your .block_header
class.
If you want the entire page to centre itself in the same way, I suggest that you wrap the header and the content in an outer div
that does the centering with a single class
Upvotes: 1