How to use + < > sign on css?

Discussion in 'CSS' started by huseinbandi, Dec 23, 2012.

  1. #1
    guys.. i need your help. btw, how to using + < > sign on css?

    this is my case:
    when i use this code below, the code is working properly:
    #arsip:hover > div:first-child
    #arsip:hover > div:nth-child(2)

    but when i merge that code like this..it doesn't work:
    #arsip:hover > div:nth-child(2) + div:first-child,
     
    huseinbandi, Dec 23, 2012 IP
  2. deathshadow

    deathshadow Acclaimed Member

    Messages:
    9,732
    Likes Received:
    1,999
    Best Answers:
    253
    Trophy Points:
    515
    #2
    My advice is don't -- if you need selectors that fancy, there's probably something wrong with your code... much less the poor support in legacy (and even modern) browsers for sibling selectors and their ilk.

    Though your logic for that doesn't make any sense... you want the first child inside the 2nd child that's only in the hover?

    Could you post an example of what you are trying to accomplish -- I've got the feeling you are REALLY over-thinking whatever it is you are trying to do here.

    Oh, and there is no <, only >
     
    deathshadow, Dec 24, 2012 IP
  3. huseinbandi

    huseinbandi Well-Known Member

    Messages:
    1,060
    Likes Received:
    3
    Best Answers:
    0
    Trophy Points:
    130
    #3
    hey.. thx for your advice. but i'm really need to understand bout this technique..

    btw, this is my case.. please help me..
    and this is my blog that i'm try to implement:

     
    huseinbandi, Dec 24, 2012 IP
  4. manioxy

    manioxy Greenhorn

    Messages:
    22
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    23
    #4
    huseinbandi

    You should try using this code instead,

    #arsip:hover > div:nth-child(2), #arsip:hover >div:first-child
     
    manioxy, Dec 29, 2012 IP
  5. philip.morris236

    philip.morris236 Active Member

    Messages:
    188
    Likes Received:
    2
    Best Answers:
    0
    Trophy Points:
    50
    #5
    as u started your div code ... i.e: <div class="arsip">arsip .. you should try to start your code like this...

    .arsip:hover > div:nth-child(1), .arsip:hover > div:nth-child (1)
     
    philip.morris236, Mar 4, 2013 IP