Answers for "autosize text css"

2

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;
}
Posted by: Guest on July-06-2020
0

text size to fit button

/*I have absolutely no idea how to do this properly*/
/*The closest I can do is - */
/*Make the text just right, trial and error with:*/
text-align: center;
font-size: 20px;
Posted by: Guest on October-22-2020

Browse Popular Code Answers by Language