Reputation: 1277
I have this HTML
.h1 {
text-transform: uppercase;
max-width: 50%;
font-size: 24px;
font-weight: 700;
line-height: 24px;
}
.scada {
font-family: Scada, sans-serif;
}
.left {
float: left;
}
<h1 class="h1 scada left">Laptop Lenovo IdeaPad 100 (80MJ003YUA)</h1>
<div class="code left">code: U0140224</div>
On big resolution it works just fine.
But when the resolution gets smaller, and the text in this h1 tag (by the way I tried swapping it with a div tag, no difference) goes on a new line, the tag still occupies space on it's right.
It's not margin/padding/border for sure. I've also tried changing the max-width. Nothing helped so far. Any ideas?
UPDATE Sorry, I didn't ask the question properly. I need to be just like it is, on a new line, but not to occupy the whitespace on it's right.
Upvotes: 1
Views: 134
Reputation: 5869
.h1 {
text-transform: uppercase;
max-width: 79%;
font-size: 24px;
font-weight: 700;
line-height: 24px;
word-break: break-all;
}
.scada {
font-family: Scada, sans-serif;
}
.left {
float: left;
}
<h1 class="h1 scada left">Laptop Lenovo IdeaPad 100 (80MJ003YUA)</h1>
<div class="code left">code: U0140224</div>
Upvotes: 1