Given the following snippet:
div {
width: 150px;
line-height: 1.5;
}
a,
button {
background: red;
}
button {
display: inline;
font-size: inherit;
font-family: inherit;
padding: 0;
margin: 0;
border: none;
text-align: left;
}
<div>
Some text
<a>
<span>abcdefghi abcdefghi abcdefghi abcdefghi</span>
</a>
Some text
<br />
<br /> Some text
<button>
<span>abcdefghi abcdefghi abcdefghi abcdefghi</span>
</button> Some text
</div>
How would I make it so that the second block with <button>
as a wrapper looks identical to the one with <a>
as a wrapper?
I'm trying to make a in-text button to open a modal and problem occurs when the text wraps to a newline. Sure I can just use <a>
but that wouldn't be semantically accurate.
Setting white-space: nowrap
is not an option.
I would think display: inline
would've solved it but are there any internal browser styles that I'm missing?
This needs to be IE10 compatible so I can't use display: content
or unset: all
.