Forums

The forums ran from 2008-2020 and are now closed and viewable here as an archive.

Home Forums CSS Help with (what I think are) Complicated Pseudoclasses

  • This topic is empty.
Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #201672

    Here are the two pages in question:
    30CARE: http://30dollartech.com/30care-support-plans
    CORE24: http://30dollartech.com/core-24-support-plans

    Initially I was only going to offer 30CARE but then realized I needed a product offering for servers, so I created CORE24. I bring this up because the way I got each section of the pricing table to be a particular color was formulated around the idea that there wouldn’t be another pricing table on the site… and now there is.

    Here’s the CSS I’m using to color the tables. You can see that on the CORE24 page this works. On the 30CARE page however, you can see that it does not.

    .stack-pricing div:nth-of-type(1n+0) ul.price-list .row-title {
      background: #179100;
    }
    
    .stack-pricing div:nth-of-type(2n+0) ul.price-list .row-title {
      background: #097288;
    }
    
    .stack-pricing div:nth-of-type(3n+0) ul.price-list .row-title {
      background: #e9840d;
    }
    

    I am very new to pseudoclasses and I don’t fully understand the mathematical operators. I expected that I could just make a 4n+0 and 5n+0 and a 6n+0 to deal with the new table but doing that breaks everything (color wise).

    I’m sure this is simple but I’ve been at it for two hours and I can’t figure it out.

    Can anyone help?

    #201676

    Thank you, so much, for taking the time to explain that Senff. I appreciate it very much. I’ll give it a whirl. If you don’t hear back from me it’s because it worked. Thanks again.

    Tanner

    #201679

    Jerba, thanks.

    Senff, I still have the issue but now it’s in reverse. I hope I’m not being dense here. My modified codes is now:

    .stack-pricing div:nth-of-type(2) ul.price-list .row-title {
      background: #179100;
    }
    
    .stack-pricing div:nth-of-type(3) ul.price-list .row-title {
      background: #097288;
    }
    
    .stack-pricing div:nth-of-type(4) ul.price-list .row-title {
      background: #e9840d;
    }
    

    It works on 30CARE but not on CORE24. Shouldn’t that not happen? I mean, the browser doesn’t know there’s another table on the site. Shouldn’t it treat the tables on CORE24 the same way it treats the tables on 30CARE? 2,3,4 doesn’t become 5,6,7 for the CORE24 page … does it?

    #201690

    How silly. I’ve given them both titles now. Thank you, Senff, for your patience and your insight. Have a good week.

Viewing 4 posts - 1 through 4 (of 4 total)
  • The forum ‘CSS’ is closed to new topics and replies.