www.webdeveloper.com
Results 1 to 2 of 2

Thread: Strange results using nth-of-type selector

Hybrid View

  1. #1
    Join Date
    Mar 2010
    Posts
    281

    Strange results using nth-of-type selector

    Strange Indeed,

    i'm getting some strange results using :nth-of-type for p tags, and also h2 tags.
    i did a test here on a simple page and it works as expected.

    http://www.tomcarden.net/dev/css-nth.html

    the code is simply:

    PHP Code:
    p:nth-of-type(1) {color:#f00}
    h2:nth-of-type(1) {color:#f00} 
    it is the same on both pages.
    but when adding to a developed page, two P's and two H2 are being selected.
    there are tags left open by mistake.

    http://www.tomcarden.net/dev/faux.html

  2. #2
    Join Date
    Aug 2011
    Location
    Worthing, West Sussex
    Posts
    96
    I don't see your problem?

    Consult this page is you're confused with what nth you should be using: http://reference.sitepoint.com/css/css3psuedoclasses
    Titanium Web Designs Ltd - Bespoke websites and online systems

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center



Recent Articles