Reputation: 63
When scaling page to a minimum, text displays incorrectly. Here is URL to this page.
Here is short code with same problem:
<!DOCTYPE html>
<HTML>
<HEAD>
<TITLE>thisistest</TITLE>
</HEAD>
<BODY>
<DIV style='width:180px;background-color:gray;font-size:small;'>
thisistest thisistest thisistest
</DIV>
</BODY>
</HTML>
Upvotes: 2
Views: 203
Reputation: 195
The icon and text are inside a button and you can imagine it as if they treated like text: If there is not enough space in the current row, leave the current things in the row and begin a new one - like in a Text-Editor. But in your case, it also centers the things inside the button.
<button style="text-align: left">
will keep the icons and everything on the left side.
Change the 320px
to 20rem
from the container's width.
A few years ago, pixel would be the right choice, but many things changed and rem is now the better choice.
An insight into the difference between px and rem you could read about here, but the accepted answer is from 2012, and the second answer is the most recent one and better applicable in today's website programming: Should I use px or rem value units in my CSS?
An additional option is that you organize the space inside your buttons. Like this:
<button>
<div style="float:left">
<img src="images/agreement.svg" style="width:12px;vertical-align:middle;">
</div>
<div style="float: left">
<ii style="vertical-align:middle;">пользовательское соглашение</ii>
</div>
</button>
BUT this won't work well if your language - like in your case - has words that are longer that the space available for it. The word will just start in the second row, since there is no space in the first row for it.
button {
width: 400px;
font-size: 36px;
}
<button>SomeReallyLongWordThatCannotBeContainedInASingleLine</button>
Use word-wrap for that.
button {
width: 400px;
font-size: 36px;
word-wrap: break-word;
overflow-wrap: break-word
}
<button>SomeReallyLongWordThatCannotBeContainedInASingleLine</button>
Upvotes: 3
Reputation: 9614
Hermueller's answer is totally correct, but in your case you can do one simple/short fix:
BB.block-head,
BB.block-body-bottom-line {
white-space: nowrap;
}
Since it prevents line breaks, than it will keep the layout as is.
Upvotes: 1