It appears you have not yet registered with DEVPPL. To register please click here... (it's fast, easy and free!)

Forum

Log In Sponsors
Board index Programming CSS Forum

easiest way to redefine a class

easiest way to redefine a class

Postby siege on Tue Apr 15, 2008 11:25 pm

Say you want to just change one property of a class every instance its used - whats the easiest way to do this? I have created a class and would like to change the background color to a different color each time i use it.


<!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>bkgd</title>
<style type="text/css">
<!--
.sections {
padding: 0px;
margin-top: 0px;
margin-right: 0px;
margin-bottom: 5px;
margin-left: 0px;
border-top-width: 0px;
border-right-width: 0px;
border-bottom-width: 0px;
border-left-width: 0px;
position: relative;
width: 800px;
}

}
-->
</style>
</head><body>
<div id="cont">
<!--background-color: different colors for each instance of section -->
<div class="sections">red background</div>
<div class="sections">blue background</div>
<div class="sections">green background</div>
</body>
siege
 
Posts: 31
Joined: Fri Apr 20, 2007 11:03 pm

Postby dflynn on Wed Apr 16, 2008 12:24 am

you can use
<div class="sections" style="background-color:#000000;">
in your code.
User avatar
dflynn
500+ Club
 
Posts: 860
Joined: Wed Oct 03, 2007 9:06 pm
Location: Guelph, Canada

Postby siege on Wed Apr 16, 2008 3:41 am

thank you
siege
 
Posts: 31
Joined: Fri Apr 20, 2007 11:03 pm


Who is online

Users browsing this forum: No registered users and 0 guests