Forum Moderators: not2easy

Message Too Old, No Replies

can css use incremnet?

         

tonynoriega

5:15 pm on Sep 3, 2010 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



is there a way to shorten this down so by using some form of increment?

(i know... stupid question, but i had to ask.... )

#timeline-2010-1, #timeline-2010-2, #timeline-2010-3, #timeline-2010-4, #timeline-2010-5, #timeline-2010-6, #timeline-2010-7, #timeline-2010-8, #timeline-2010-9, #timeline-2010-10, #timeline-2010-11, #timeline-2010-12, #timeline-2010-13, #timeline-2010-14, #timeline-2010-15, #timeline-2010-16, #timeline-2010-17, #timeline-2010-18, #timeline-2010-19, #timeline-2010-20{
display:none;
background:url(/_images/employer-toggle-bg.png) 0 0 no-repeat;
height:250px;
width:645px;
padding:20px 35px 30px 20px;
position:relative;
margin: -300px 0 50px 0;
}

Major_Payne

6:10 pm on Sep 3, 2010 (gmt 0)



Make it a class:


.timeline-2010 {
display:none;
background:url(/_images/employer-toggle-bg.png) 0 0 no-repeat;
height:250px;
width:645px;
padding:20px 35px 30px 20px;
position:relative;
margin: -300px 0 50px 0;
}


Then, instead of id="blah" in the tags, it'll be class="timeline-2010" for all of them. Only use the id="" when you deviate from the class for that tag:

<div class="timeline-2010" id="timeline-2010-1"> ... </div>

tonynoriega

6:52 pm on Sep 3, 2010 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



roger that.

thanks