Jump to content

Can You Make This A .class?


ben03

Recommended Posts

Not a master of CSS so was wondering whether you could make this following code into a class as it is repeated down a page multiple times with the only variation being to 'top' attribute. If it's possible how would you go about this? Thanks.

#club_container{			position: absolute;			top: 0px;			left: 0px;			width: 660px;			height: 220px;			background: #eee;			text-align: left;			background-image:			url('images/club_details_backing.gif');			background-repeat: no-repeat;			z-index: 4;			}

(Basically the CSS file is getting very long with #club_container2,3,4,5 etc...)

Link to comment
Share on other sites

Simple. Just change # (pound) to . (period) in your CSS, and when you target your element, you use class.

<div class="club_container"></div>

.club_container{			position: absolute;			top: 0px;			left: 0px;			width: 660px;			height: 220px;			background: #eee;			text-align: left;			background-image:			url('images/club_details_backing.gif');			background-repeat: no-repeat;			z-index: 4;}

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...