Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8274061
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T07:37:51+00:00 2026-06-08T07:37:51+00:00

This is what makes me cry at night. One would wish that CSS had

  • 0

This is what makes me cry at night. One would wish that CSS had a directive margin-collapse:none;, but alas, that is from my imagination.

How do you get two in-flow siblings not to collapse?

I have tried overflow:hidden, clear:both, border:1px solid white both on the element and generating an element before, nothing works.

Here’s the example. H2’s are removed from the flow to look pretty on the side, not collapsing, while H3 sits there collapsing with its predecessor no matter what. Now margin collapsing makes the vertical alignment of H2 and H3 in a coherent fashion, independent of the preceding element, impossible.

The constraint: HTML markup cannot be added, as the content is generated via Markdown.

Is this solvable?

Edit: In fact, the goal here was to make the h2 and their first h3 to come up at the same height.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-08T07:37:52+00:00Added an answer on June 8, 2026 at 7:37 am

    One Solution

    In your particular case, it appears that you would not necessarily need to take h2 out of flow, and rather set it to position: relative, because it should achieve the effect you want.

    However, that does not really solve your question of margin collapse.

    Another Solution

    If you set the h3 that follows an h2 to display: inline-block, using…

    h2+h3 {display: inline-block;}
    

    …then it resolves your collapsing issue, assuming you do not have inline elements immediately following the h3 tag. It appears that you plan on having any following text in a block level p tag, so that should not be an issue.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I hope this makes sense... It doesn't only apply to c#, but that is
This makes no sense to me. I've been trying to research this, but I
I tried using height: 100% but this makes the div only as high as
I have an app that can make modify images. In some cases, this makes
This XAML makes text fade in when it appears. I would like to put
I know the title makes this sound very easy, but I have a For
I just came a cross this nice code that makes this scatter matrix plot:
I imagine this makes no difference, but I will try to access it using
hope this makes sense. I have merged together two tables one containing information about
I have tried everything and this makes absolutely no sense! I previously had Less.js

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.