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.

Background Colour

Featured Replies

I am coding my first site and have used the code in the sticky here to center the site which has a width of 960px.

 

The problem is that when I assign a background colour to an element, it only spans across that 960 width, whereas I want it to span across the entire browser window. I tried using a width: 100% tag but it still only spans across the 960 width. Is there anyway to make it span to the browser edges?

body {
background:#000000;
}

 

OR - It can't hurt to put a blank wrap around your entire site either, like this:

<div id="wrap">

<div id="centered_box">width 960</div>

</div>

 

#wrap {
background:#000000;
}

#centered_box {
margin:auto:
width:960px;
background:#ffffff;
}

I think what you want to do is set the body (entire browser window?) to a colour, then set the colour of your wrapper.

 

The example below (using the faq code) gives a red body and blue wrapper - obviously you change colours to suit your design

 

body {
text-align:center;
background-color: #FF0000;
}
#wrapper {
margin: 0 auto;
width: xxxx; /* Replace the xxxx with the the width of your site (eg 800px)*/
text-align:left;
background-color: #0000FF;
}

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.