Go Back   CodingForums.com > :: Client side development > HTML & CSS

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 10-03-2012, 07:53 AM   PM User | #1
tarasmuz
New Coder

 
Join Date: Oct 2012
Location: Edinburgh
Posts: 10
Thanks: 3
Thanked 0 Times in 0 Posts
tarasmuz is an unknown quantity at this point
Question 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
tarasmuz is offline   Reply With Quote
Old 10-03-2012, 07:57 AM   PM User | #2
Sammy12
Registered User

 
Join Date: Jun 2011
Posts: 1,063
Thanks: 12
Thanked 241 Times in 240 Posts
Sammy12 is on a distinguished road
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/

Last edited by Sammy12; 10-03-2012 at 08:03 AM..
Sammy12 is offline   Reply With Quote
Users who have thanked Sammy12 for this post:
tarasmuz (10-03-2012)
Old 10-03-2012, 08:06 AM   PM User | #3
tarasmuz
New Coder

 
Join Date: Oct 2012
Location: Edinburgh
Posts: 10
Thanks: 3
Thanked 0 Times in 0 Posts
tarasmuz is an unknown quantity at this point
Thank you so much
tarasmuz is offline   Reply With Quote
Reply

Bookmarks

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 04:34 PM.


Advertisement
Log in to turn off these ads.