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 Layout Help

Featured Replies

Hey everyone.

 

I am experiencing a lot of frustration with CSS right now. I am trying to place everything inside a div which has a background color of white. For some reason the color only shows for the top part and not the rest. Also, my "PHP include's" are not showing up as well. The page is www.adamstorr.com/ama/ and the HTML and CSS is below:

 

Thank you!

 

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title>Welcome to the SDSU American Marketing Association</title>
<link href="css/global.css" rel="stylesheet" type="text/css" />
</head>

<body>


<div id="wrapper">
<div id="header"></div>
<?php include("files/navbar.php"); ?>

<div id="stickynote"></div>

<div id="leftsidebar">
<?php include("php/leftsidebar.php"); ?>
</div>

<div id="mainarea">
<h1><span></span>latest news</h1><br />
<img src="images/bar.png" alt="bar" /><br /><br />

<span class="date">Date</span><br /><br />
<span class="title2">Title</span><br /><br />
<span class="body">Brief</span>

<a href="newspost.php?Number=Number" class="readmore"> read more</a>
<br />

<img src="images/bar.png" alt="bar" /><br />

<a href="newspost.php?Number=Number#comments" class="comments">

0

comments</span></a><br /><br />

<h1><span></span>pictures</h1><br />
<img src="images/bar.png" alt="bar" /><br /><br />
<!-- Insert Flickr Flow here -->
</div>

<?php include("php/footer.php"); ?>

</div>

</body>
</html>

 

 

CSS Code:

@charset "UTF-8";
/* CSS Document */

body {
background:url(../images/bkg.gif);
}

#header {
background:url(../images/header.png);
background-repeat:no-repeat;
position: relative;
width:905px;
height:300px;
left: 20px;
}

#wrapper {
width: 900px;
margin-left: auto;
margin-right: auto;
margin-top: 0;
margin-bottom: 0;
background-color:#FFFFFF;
z-index:0;
}

#stickynote {
background:url(../images/stickynote.png);
background-repeat:no-repeat;
position:absolute;
height:201px;
width:180px;
top: 240px;
}

#leftsidebar {
float:left;
width: 270px;
padding: 5px;
z-index:2;
}

#mainarea {
float:right;
width: 630px;
padding: 5px;
z-index:2;
}

.date {
font-family:Arial, Helvetica, sans-serif;
font-size:18px;
letter-spacing:0px;
color:#666666;
}

.title2 {
font-family:Arial, Helvetica, sans-serif;
font-size:20px;
letter-spacing:-1px;
color:#990000;
}

.body {
font-family:Arial, Helvetica, sans-serif;
font-size:14px;
letter-spacing:0px;
color:#999999;
}

.readmore {
font-family:Arial, Helvetica, sans-serif;
font-size:14px;
letter-spacing:0px;
color:#990000;
}

.comments {
font-family:Arial, Helvetica, sans-serif;
font-size:11px;
letter-spacing:0px;
color:#666666;
}

h1 {
font-family:Arial, Helvetica, sans-serif;
color:#A90003;
font-size:38px;
letter-spacing:-1px;
font-weight:900;
position:relative;
}

h1 span {
background: url(../images/grad.png) repeat-x;
position: absolute;
bottom:4px;
display: block;
width: 36%;
height: 50px;
}

try skipping the () in your includes.

You are positive the path to the stylesheet is correct?

Hi

 

Add overflow:auto; to your #wrapper that should sort out the white background.

 

pat

  • Author

Thanks Pat! The overflow worked beautifully.

 

boblet, I tried removing the () and it still is the same.

 

Thank you both.

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.