I have a text over many lines. Example:
Can the text be adapted to the div?
In this example, after the word "text" there is a space with color blue. In CSS there is a method to avoid the blue space after the word "text"?
If I have several texts with different lengths, is there a way to generalize this behavior?
.box {
border: 1px solid red;
width: 200px;
position: relative;
padding-top: 40px;
}
.label {
position: absolute;
top: -10px;
background-color: blue;
}
<h1>My First Heading</h1>
<div class="box">
I'm a box.
<div class="label">
I'm a label without a text wrapped.
</div>
</div>