Forums

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

Home Forums CSS Borders, Padding & Collapsed Margins

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

    How does a border and padding prevent margins from collapsing from a parent/first-child relationship?

    Is it that applying a border to the parent sets a context for the child to add margin? Is it as simple as the border separates the two?

    I’m looking for a more CSS technical answer, if any, as to why this is?

    #247292
    Paulie_D
    Member

    Probaly easier to read the spec of you want a technical answer.

    https://www.w3.org/TR/CSS21/box.html#collapsing-margins

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