Forums

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

Home Forums CSS Continuation topic: understanding positioning and parent?

  • This topic is empty.
Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #250237
    CranberryJuice
    Participant

    This is a continuation from https://css-tricks.com/forums/topic/how-to-set-menu-text-properly-against-menu/#post-250045

    I wanted to better understand how I could have figured out what thing is the parent in this case. Or perhaps, why the parent wouldn’t have been another step lower?

    #250240
    Shikkediel
    Participant

    Absolute positioning applies to the first parent in line that has positioning other than static (which is the value any element also gets by default).

    #250254
    CranberryJuice
    Participant

    Hi! Better question is why wouldn’t nav ul li not be a candidate, and why would nav ul li a also not work?

    #250268
    Shikkediel
    Participant

    If you give either of these relative positioning, they will effectively be candidates. But it doesn’t really match the layout and desired effect well. Maybe I’m not exactly understanding the question though.

    #250293
    CranberryJuice
    Participant

    Hopefully a better question: Whats the difference in effect if relative positioning was applied to nav versus nav ul? What’s the difference in effect if relative positioning was applied to nav ul li versus nav ul li a?

    #250295
    Shikkediel
    Participant

    The size and position of the relatively positioned parent element is the only difference because the hover effect will place the hidden element to the outer right of it. One could make the layout in such a way that there would really be no directly visible difference.

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