How to remove whitespace between HTML elements when using line breaks?

Spread the love

Sometimes, we want to remove whitespace between HTML elements when using line breaks.

In this article, we’ll look at how to remove whitespace between HTML elements when using line breaks.

How to remove whitespace between HTML elements when using line breaks?

To remove whitespace between HTML elements when using line breaks, we use flexbox.

For instance, we write

.image-wrapper {
  display: flex;
}

to make elements with class image-wrapper a flex container with display: flex;.

Then we whitespace between elements inside the elements with class image-wrapper are removed.

Conclusion

To remove whitespace between HTML elements when using line breaks, we use flexbox.

Leave a Reply

Your email address will not be published. Required fields are marked *