CodingForums.com

CodingForums.com (http://www.codingforums.com/index.php)
-   HTML & CSS (http://www.codingforums.com/forumdisplay.php?f=13)
-   -   Having a problem with coloring in the hole DIV (http://www.codingforums.com/showthread.php?t=275008)

tarasmuz 10-03-2012 07:53 AM

Having a problem with coloring in the hole DIV
 
Hello,

I'm having trouble with coloring in a DIV. I was googling and I didn't find any solutions that would help me. I have to DIV. 1 DIV is a div to keep the hope web-site centered and the second one is the one which should be at the top and it should be colored in (completely)
This is my code:

HTML:

Code:

<!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>JFM</title>
<link rel="icon"  type="image/ico" href="favicon.ico" />
<link href="css/styles.css" rel="stylesheet" type="text/css" />
</head>

<body>

<div class="whole_site_container">

        <div class="top_blue">
        </div>
       
</div>
</body>
</html>

CSS:

Code:

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

#whole_site_container {
        width: 1000px;
        margin-right: auto;
        margin-left: auto;       
}

#top_blue {
        width: 1280px;
        height: 100px;
        background-color: #01A4A4;
}

Thank you :)

Sammy12 10-03-2012 07:57 AM

For targeting classes you use a ".":

Code:

.whole_site_container {
        width: 1000px;
        margin-right: auto;
        margin-left: auto;       
}

.top_blue {
        width: 1280px;
        height: 100px;
        background-color: #01A4A4;
}

A hash ("#") is used for id's:

Code:

<div id="this_is_an_id">

</div>

http://www.htmldog.com/guides/cssintermediate/classid/

tarasmuz 10-03-2012 08:06 AM

Thank you so much :)


All times are GMT +1. The time now is 09:01 AM.

Powered by vBulletin®
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.