Grow your CSS skills. Land your dream job.

display-inline-block margins do not collaspe with its neighbor?

  • # February 23, 2013 at 3:06 pm

    I need two anchors to display side by side as buttons. I need their margins to collapse top and bottom with their neighbors. And I need them both or just one anchor to clear (so stay above) their below neighbor. Some times there will be both and some times only one. Display tables margins do collaspe but they do not allow for both anchors to go side by side. I could just wrap them both in a container but I dont want to.

    Ideas?

    TEST PAGE:

    http://www.websitecodetutorials.com/projects/testing.html

    # February 23, 2013 at 3:28 pm

    can you leave them as inline? According to the specs whether they are inline-block, float, or AP the margins will not collapse…

    why not just target the anchors and remove the margin?

    # February 23, 2013 at 3:39 pm

    Hello. Can’t do inline because I need a bottom margin on them. Can’t just target the anchors because I need one size fits all on 500 pages. Some times I’ll have paragraphs above or below them and sometimes not. If I can’t figure it out then ill just wrap them in a P float the anchors and margin the static P.

Viewing 3 posts - 1 through 3 (of 3 total)

You must be logged in to reply to this topic.

*May or may not contain any actual "CSS" or "Tricks".