Forums

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

Home Forums CSS [Solved] Removing Margin at the Bottom of a Specific List

  • This topic is empty.
Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #160740
    siouxfan45
    Participant

    You can see my sidebar here

    Right now, I have each section broken up via a bottom margin on my list #sidebar ul. That is, each section is a list (

    ).

    As you can see by the red I added, this margin as added to the last list as well.

    Here’s my question – since nth child can’t be used on the list itself, is there an easy way to get rid of this margin? Should I be doing my markup differently?

    #160741
    chrisburton
    Participant

    What is your browser support? You can use .sidebar ul:first-of-type. But you will need to remove margin-bottom: 2em; from .sidebar ul.

    In this case, I would recommend wrapping each heading and its child content in a block-level element (i.e. div).

    Unrelated:

    You need to calm down on the line-height of your body copy. I would choose a different typeface and depending on the x-height, bump up the font-size.

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