Closed (fixed)
Project:
Basic
Version:
5.x-1.x-dev
Component:
Code
Priority:
Normal
Category:
Support request
Assigned:
Unassigned
Reporter:
Created:
20 Nov 2008 at 12:18 UTC
Updated:
6 Nov 2010 at 08:10 UTC
Jump to comment: Most recent
I am trying to create a full-width header on a fixed-width page.
Question for the CSS experts out there: is there a trick, e.g. by using negative margins or something, to make the #header paggind stretch over on the sides the #page width?
Thanks.
Comments
Comment #1
Gabriel R. commentedThis sort of works, but it adds an unwanted horizontal scroll bar:
If only `overflow-x` would work :-s
Comment #2
Anonymous (not verified) commentedNo, this is definitelly not the way to go :)
More simply, do not hesitate to edit the page template and take the header out of the #page. As everything that is inside the #page is restricted to a width, taking the header out of it (so making the #page start with the #main) is going to free the header from the #page restrictions.
so it would be like this :
As a general rule, make the markup the way you want before tricking the css, css rules shouldn't have be too complicated ;)
Comment #3
Gabriel R. commentedYeah, that's what I'll end up doing, but I think I actually seen the CSS-only method work somewhere. Just can't remember where.
Comment #4
Anonymous (not verified) commentedIf you realy want to keep the header unchanged in page tpl, the other way around would be to position the header absolutely, to take it out of the page flow, and then move the page down to the size of the header, like this :
#header { layout.css (line 101)
position:absolute;
left:0;
top:0;
width:100%;
}
#page { main.css (line 12)
margin-top:(-> header height);
}
Comment #5
Gabriel R. commentedThanks. That makes sense.
I ended up just adding a BG image on the body instead of #header :-)
Comment #6
Anonymous (not verified) commented