Reputation: 33
I am building my website and come across this tricky issue:
With the same external css, pages display differently (such as the about page and experience page).
I've examined the difference between the two and tried several simple workarounds, none has worked. By noticing that the pagebody div is aligning with the page title, I have extended the page title to "Past Experience" (example).
Can any of you help me to figure out the real problem? Is there an issue with the stylesheet?
Thanks in advance!
Upvotes: 3
Views: 70
Reputation: 25445
Just add this to your CSS:
#headline { overflow:hidden; }
Your problem here is that your floated nav and logo are not cleared / contained, so that the elements after the float can continue on the next line and return the normal document flow.
Also when you use floats, its better to have a width
set on the floated elements. Width can be in any unit, px
, em
or %
You could also do this as an alternative:
#pagebody { clear:both; }
which is code to clear left and right floats and return #pagebody
to normal document flow under #headline
Upvotes: 0
Reputation: 1713
Your problem can be fixed by adding the following:
#pagebody{clear: left;}
Upvotes: 4
Reputation: 57322
just add in css
#headline {
float: left;
width:100%;
}
result
Upvotes: 0