Here is what I want to do:
- Keep some text and a button at the same line and align center
- When reduce the screen size, always keep the button showing up while text-overflow: ellipsis taking effect
What I did so far can't keep the button showing up. Ellipsis only starts working when the window edge reaches the text.
HTML:
<div class="wrapper">
<span>
foo bar foo bar foo bar foo bar foo bar foo bar foo bar foo bar foo bar
</span>
<button type="button">Download</button>
</div>
CSS:
.wrapper {
text-align: center;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
background-color: #b3ffcb;
}
Anyone know how to fix this?