Jump to content


CSS content box


3 replies to this topic

#1 Joey_Bose

    Young Padawan

  • Members
  • Pip
  • 60 posts
  • Gender:Male
  • Location:Kentucky, USA
  • Interests:I love basketball, webdesign, mathematics, physics, reading, and general computer programming.

Posted 06 August 2006 - 06:45 PM

Hey everyone!

I have started to code a CSS layout, but have ran into some trouble.
My problem is that the content box that I created will not show the border nor background color. Could someone please take a look at the code and my site and try and figure out whats wrong?

www.joeybose.com is the site. I have my "contentbox" div nested within the "content" div (the content div is the middle section)

Here is the stylesheet code:

body {
  background:#243E52; 
   }
#header {
  background:url(images/Header.jpg) no-repeat;
  width:600px;
  height:160px;
}
#footer {
  background:url(images/Footer.jpg) no-repeat;
  width:600px;
  height:152px;
}  
#content {
  background:url(images/Content.jpg) repeat-y;
  width:600px;
}
#contentbox
{
width:300px; // this is a real content box, quite wide
border: 1px solid #CCC; // grey in color
background-color: #FFF; // white
padding: 2px; // padding the walls
}
p {
  margin:0px 40px;
  padding-bottom:20px;
  line-height:1.5em;
}
a {
color: #243E52;
}
a:hover {
color: #8E481E;
}

Thanks!

Joey

#2 Tec222

    Young Padawan

  • Members
  • Pip
  • 14 posts

Posted 07 August 2006 - 09:48 PM

well the background would not be

background:#243E52; This is wrong


it would be

bgcolor:#243E52;



ill get the border in a sec

Edited by Tec222, 07 August 2006 - 09:49 PM.


#3 laurie-J

    Young Padawan

  • Members
  • Pip
  • 29 posts
  • Gender:Male
  • Location:Australia

Posted 08 August 2006 - 02:38 AM

ummm actually I'm afraid you are wrong, background: #243E52; is indeed correct. I'm afraid im not sure about why its not working, maybe be more specific and put 'background-color: #243E52;' but im not sure why you would need that.

#4 _*Zenom_*

  • Guests

Posted 08 August 2006 - 03:16 AM

Save this as HTML. I think the problem came from your CSS comments.
<!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=iso-8859-1" />
<title>Untitled Document</title>
<style type="text/css">
body {
  background:#243E52;
   }
#header {
  background:url(images/Header.jpg) no-repeat;
  width:600px;
  height:160px;
}
#footer {
  background:url(images/Footer.jpg) no-repeat;
  width:600px;
  height:152px;
}  
#content {
  background-color: #548745;
  width:600px;
}
#contentbox
{
width:300px; 
border: 1px solid #CCC; 
background-color: #968521; 
padding: 2px; 
}
p {
  margin:0px 40px;
  padding-bottom:20px;
  line-height:1.5em;
}
a {
color: #243E52;
}
a:hover {
color: #8E481E;
}
</style>
</head>

<body>
<div id="content">
content

<div id="contentbox">
contentbox
</div>
</div>

</body>
</html>






1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users