Forums

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

Home Forums CSS Split nav and responsive breakdown

  • This topic is empty.
Viewing 11 posts - 1 through 11 (of 11 total)
  • Author
    Posts
  • #42700
    wadem
    Member

    Hi,
    Not sure how to do this.
    I am making a nav bar that has the logo in the center with 2 nav links on either side.
    I am note sure how to semantically set this up and have it work well with breakpoints.

    Here is my current markup with no styling: http://codepen.io/anon/pen/kEpqb

    Not sure if that makes sense.

    Any help would be greatly appreciated.

    #124387
    chrisburton
    Participant
    #124389
    Kitty Giraudel
    Participant

    @Chrisburton’s solution is the way to go. You have to consider your logo as a list item.

    Unfortunately, it doesn’t seem to make much sense regarding semantic. A logo shouldn’t be part of the main navigation.

    #124392
    wadem
    Member

    [@Chrisburton](https://css-tricks.com/forums/profile/Chrisburton “@Chrisburton”) That is fantastically helpful. Thank you.

    #124393
    chrisburton
    Participant

    @wadem I updated my code and I think I’d go with Option 1 in this case. It would be much easier to maintain.

    http://codepen.io/chrisburton/pen/nGliq

    #124395
    wadem
    Member

    @chrisburton
    I do like Option one.
    Question though: When on a lower browser width I want to position the logo first and then the nav below it? ie responsive mobile friendly site.
    Thanks for your help.

    #124396
    chrisburton
    Participant

    @wadem The only way I can think of is creating extra markup but hiding it until it hits the breakpoint. Then, hide that list-item I created. Make sense?

    http://codepen.io/chrisburton/pen/nGliq

    #124398
    wadem
    Member

    Yeah makes sense. I forgot its common to have 2 sets of nav in responsive design.
    Thanks again @chrisburton

    #124400
    chrisburton
    Participant

    @wadem The good thing is that you don’t need additional `nav` markup in your case. Just swap hiding an `h1` and a list-item. Glad I could help.

    #124402
    wadem
    Member

    @chrisburton Perfect thanks, working out better than I imagined.

    #124404
    wolfcry911
    Participant

    [Here’s a pen](http://codepen.io/wolfcry911/pen/HyLdg “”) I forked a while back showing another way of split nav. At certain breakpoints you could remove the left margin and reposition the logo (which I don’t believe belongs in the nav).

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