Jump to content

Can You Make This A .class?


ben03
 Share

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...)

Edited by ben03
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;}

Edited by RahXephon
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...