ben03 Posted December 14, 2009 Share Posted December 14, 2009 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 More sharing options...
Err Posted December 14, 2009 Share Posted December 14, 2009 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 More sharing options...
ben03 Posted December 15, 2009 Author Share Posted December 15, 2009 Sorted it. Many thanks for the help (will save loads of time ) Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.