Answers for "css relative font size"

CSS
7

css change text size

p {
	font-size: 150% /*px, cm, in, etc.*/; 
}
Posted by: Guest on May-14-2020
3

vh and vw

/*vh viewport height and vw viewport width*/
/*example*/
div
{
  display: inline-block;
  height: 100vh; /*THis will set height equal to the height of windows*/
  width: 100vw/*This will set width equal to width of windows*/
}
Posted by: Guest on September-02-2020
0

em is relative to its font size

<div id='contain' style='height: 400px'>
  <div style='height: 1.5em'>Test 1</div>

  <div style='height: 50%'>Test 2</div>
</div>
Posted by: Guest on January-30-2021

Browse Popular Code Answers by Language