Skip to content
View in the app

A better way to browse. Learn more.

Web Designer Forum

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

css backgrounds

Featured Replies

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

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?

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 :)

  • 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

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.