December 12, 201213 yr Afternoon all, How can i set the backgrounds full width and scrollable content like this website http://www.shawcontractgroup.com/ has teh full width background in the header and footer, but clearly uses a container of around 1000px centered. Cheers
December 12, 201213 yr Afternoon all, How can i set the backgrounds full width and scrollable content like this website http://www.shawcontractgroup.com/ has teh full width background in the header and footer, but clearly uses a container of around 1000px centered. Cheers Does http://css-tricks.com/full-browser-width-bars/ help?
December 13, 201213 yr First you'll need to set the margins of body and html, to prevent any missing pixels html, body { margin:0; } Once you have that done you need to set the header container up. CSS: .header { width:100%; /* Makes it reach 100% of the page */ height:50px; /* Height of the header */ } HTML: <div class="header">Heading here</div> Once we have that stretching across the page we need to make the container in the middle, of 1000px. CSS: .content { width:1000px; margin-left:auto; /* Makes it centre in the page*/ margin-right:auto; height:200px; } HTML: <div class="content">Content goes in here.</div> Now we need to do the footer. The footer also has the 100% width, like the header. CSS: .footer { width:100%; height:50px; } HTML: <div id="footer"> copyright footer etc </div> Hope this helped
December 17, 201213 yr Simple...you can easily do this by setting your background width to 100% ..www.agil8.com
December 17, 201213 yr Author First you'll need to set the margins of body and html, to prevent any missing pixels html, body { margin:0; } Once you have that done you need to set the header container up. CSS: .header { width:100%; /* Makes it reach 100% of the page */ height:50px; /* Height of the header */ } HTML: <div class="header">Heading here</div> Once we have that stretching across the page we need to make the container in the middle, of 1000px. CSS: .content { width:1000px; margin-left:auto; /* Makes it centre in the page*/ margin-right:auto; height:200px; } HTML: <div class="content">Content goes in here.</div> Now we need to do the footer. The footer also has the 100% width, like the header. CSS: .footer { width:100%; height:50px; } HTML: <div id="footer"> copyright footer etc </div> Hope this helped nice one, so do i just set a container inside the header and footer and set margin to auto to centre the content?
Create an account or sign in to comment