SitePoint Sponsor

User Tag List

Results 1 to 5 of 5
  1. #1
    SitePoint Guru Ize's Avatar
    Join Date
    Nov 2005
    Location
    The Netherlands
    Posts
    808
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Selecting parent element

    Today I was trying some CSS experiments and a question crossed my mind: It's possible to select an element's children, grandchildren and siblings in various ways, but is it also possible to select an element's parent?

    So I could, for example, highlight fieldsets using a red border when child-input elements have focus.

  2. #2
    doing my best to help c2uk's Avatar
    Join Date
    May 2005
    Location
    Cardiff
    Posts
    1,832
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    It's not possible with CSS and as far as I know it's also not included in CSS3 (for a better explanation http://archivist.incutio.com/viewlist/css-discuss/42942).

    What you want to achieve might be possible with Javascript, but I'm not yet knowledgable enough in that to provide you with any help there.
    Dan G
    Marketing Strategist & Consultant

  3. #3
    SitePoint Guru Ize's Avatar
    Join Date
    Nov 2005
    Location
    The Netherlands
    Posts
    808
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by c2uk
    It's not possible with CSS and as far as I know it's also not included in CSS3 (for a better explanation http://archivist.incutio.com/viewlist/css-discuss/42942).

    What you want to achieve might be possible with Javascript, but I'm not yet knowledgable enough in that to provide you with any help there.
    It is indeed possible with JS, but I prefer to leave graphics up to CSS as much as possible
    Thanks anyway!

  4. #4
    doing my best to help c2uk's Avatar
    Join Date
    May 2005
    Location
    Cardiff
    Posts
    1,832
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Your intentions are good, but I think it is acceptable to use Javascript in order to improve certain aspects of your design that cannot be achieved with other means as long as it still works without any problems if Javascript is turned off.
    Dan G
    Marketing Strategist & Consultant

  5. #5
    SitePoint Guru Ize's Avatar
    Join Date
    Nov 2005
    Location
    The Netherlands
    Posts
    808
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by c2uk
    Your intentions are good, but I think it is acceptable to use Javascript in order to improve certain aspects of your design that cannot be achieved with other means as long as it still works without any problems if Javascript is turned off.
    If not possible otherwise, I will


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
  •