I want to insert a line break after the third button in the snippet below. I found this trick and wanted to use it but it doesn't work because my button doesn't accept display: inline
and keeps the user agent style of display: inline-block
no matter what (no important and no more and more specific selector will help). Does anyone know why this is? If I instead use the trick on the a tag, it works perfectly fine.
I know I could do the line-break as well with Flexbox if I would insert a div but I can't easily change the markup.
.wrap .button-third {
display: inline;
}
.button-third:after {
content: "\a";
white-space: pre;
}
/*
.first-link {
display: inline;
}
.first-link:after {
content: "\a";
white-space: pre;
}
*/
<div class="wrap">
<button class="button-first"> Button 1</button>
<button class="button-second">Button 2</button>
<button class="button-third">Button 3</button>
<a href="" class="first-link">Link 1</a>
<a href="" class="second-link">Link 2</a>
</div>