SitePoint Sponsor

User Tag List

Results 1 to 2 of 2
  1. #1
    SitePoint Zealot
    Join Date
    Jul 2011
    Posts
    199
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    select only last attribute: possible?

    Hi.

    I'd like to know if it's possible to select only the last of a given attribute in CSS3. I'm currently using:

    Code:
    [class^="highlight"]
    But the last element should have a special treatment. I have no way to know if it's the last-child or last-of-type. I can know which is the parent element, though.


  2. #2
    It's all Geek to me silver trophybronze trophy
    ralph.m's Avatar
    Join Date
    Mar 2009
    Location
    Melbourne, AU
    Posts
    23,598
    Mentioned
    411 Post(s)
    Tagged
    6 Thread(s)
    There are probably several ways, but it would be easiest to answer if we saw your HTML. I would probably go for last-child, but if there is a class on the last element, that's easier and would work in more browsers, of course.


Bookmarks

Posting Permissions

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