stretch text to div width css
div{
background-color:gold;
text-align:justify;
}
span{
background-color:red;
width:100%;
height:1em;
display:inline-block;
}
<div>
Lorem ipsum sit dolor
<span> </span>
</div>
stretch text to div width css
div{
background-color:gold;
text-align:justify;
}
span{
background-color:red;
width:100%;
height:1em;
display:inline-block;
}
<div>
Lorem ipsum sit dolor
<span> </span>
</div>
adjust font size according container width
/**
* You can automatically increase or decrease
* the font size of the text in an element using CSS
*/
<p> Some text to automatically Adjust</p>
<style>
p {
font-size: 16px; /* The font size if container is too small */
font-size: 5vw; /* Font size adjustment in percent, if the container is larger and there is more room */
}
</style>
css text to fit container
//The viewport-percentage lengths are relative to the size of the initial
//containing block. When the height or width of the initial containing block
//are changed, they are scaled accordingly.
//vw = (% of the viewport width). So using it will look like this:
p {
font-size: 2.5vw;
}
Copyright © 2021 Codeinu
Forgot your account's password or having trouble logging into your Account? Don't worry, we'll help you to get back your account. Enter your email address and we'll send you a recovery link to reset your password. If you are experiencing problems resetting your password contact us