Is there any way to get rid of that white space after a line break?
If you highlight the text node only it actually requires less space that paragraph is trying to take.
.wrap {
background: red;
color: white;
max-width: 470px;
}
<div class="wrap">
<p>
We weren't able to change your trading or correspondence address. Please try again or come back later.
</p>
</div>
Example:
https://codepen.io/patryk-ptak/pen/yLGZjqE
@EDIT:
I mean this additional red space added after the line break.
I need that max-width
property so removing it is not an option for me.
3
Answers
I don’t know if you can insert <br> in paragraph text, but it looks like solution:
html
CSS
remove
max-width: 470px;
and<br>
as your requirement.and try also another way.
A combination of separating the elements into different paragraph tags, placing a line break in between, and changing the style to have an inline display will get rid of the extra space after the sentences.
If you add a class to the paragraph elements, use that class to target the sentences, if not, you can use this updated CSS/selector: