Quantcast
Channel: margin-top only when the flex item is wrapped - Stack Overflow
Browsing latest articles
Browse All 4 View Live

Answer by Oriol for margin-top only when the flex item is wrapped

You can add some margin-top to both flex items, and a negative margin-top of the same amount to the flex container. This way, the negative margin of the flex container will neutralize the margin of the...

View Article



margin-top only when the flex item is wrapped

I have a flex container with two flex items. I want to set a margin-top on the second one, but only when it's wrapped and not at the first flex line. If possible, I want to avoid using media queries....

View Article

Answer by Mikolaj for margin-top only when the flex item is wrapped

If your browser supports the CSS gap property you can use it like this.container { display: flex; flex-wrap: wrap; justify-content: space-around; gap: 20px;}gap adds an extra space surrounding the...

View Article

Answer by Artur INTECH for margin-top only when the flex item is wrapped

The column-gap property is also worth mentioning (in addition to what @Mikolaj already answered).So the full list of the properties involved is as follows:gaprow-gapcolumn-gap

View Article
Browsing latest articles
Browse All 4 View Live




Latest Images