WeLoveCSS Logo
Home Profile Members Search Rules Help New Posts



WeLoveCSS > WEB DESIGN > CSS > Problems with color in div

Reply
  Thread Tools Display Modes
Old 21st October 10, 01:57 PM   #1
p3aul
WLC Member
 
Join Date: Oct 2010
Posts: 3
Default Problems with color in div

I'm having trouble with css. every time i set the background-color in the css for a div It changes the whole page to that color. Is there an(attribute?) to set just the inside color of my box? I'm trying to create rounded-corner boxes of different shapes and colors for a webpage. I can get the rounded corners and colored borders but the color inside the box eludes me.

here is the css and html I quick-coded in notepad:
Code:
"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>Untitled Document</title>
<style type="text/css">
.rounded {
	-moz-border-radius:3ex;
	-webkit-border-radius:3ex;
	background-color: #ff0000;
	color: #F00;
	height: 150px;
	width: 150px;
	border: thick solid #0FF;
} 
}
</style></head>

<body class="rounded">
<div>
  <h4>Content for New Div Tag Goes Here</h4>
</div>


</body>
</html>
Thanks,
Paul
p3aul is offline   Reply With Quote
Old 21st October 10, 04:53 PM   #2
chrishirst
Banned
 
Join Date: Jun 2006
Location: Blackp ool U.K.
Posts: 3,194
Default Re: Problems with color in div

You are applying the class to the body element, so obviously the entire page will be affected.
chrishirst is offline   Reply With Quote
Old 21st October 10, 08:30 PM   #3
p3aul
WLC Member
 
Join Date: Oct 2010
Posts: 3
Default Re: Problems with color in div

Ok Thanks for replying
p3aul is offline   Reply With Quote
Reply


Thread Tools
Display Modes
Linear Mode Linear Mode

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. The time now is 05:55 AM.



Home | Advertise | Contact Us | Top
Home | Advertise | Contact Us | Top

Copyrightę 2006 WeLoveCSS.com. All Rights Reserved.
Powered by vBulletin Version 3.8.4 Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.