css set text size code example

Example 1: font size css

.class {
	font-size: 12px;
}

Example 2: text size in CSS

font-size: 2em;

Example 3: font size css

/* <absolute-size> values */
font-size: xx-small;
font-size: x-small;
font-size: small;
font-size: medium;
font-size: large;
font-size: x-large;
font-size: xx-large;
font-size: xxx-large;

/* <relative-size> values */
font-size: smaller;
font-size: larger;

/* <length> values */
font-size: 12px;
font-size: 0.8em;

/* <percentage> values */
font-size: 80%;

/* Global values */
font-size: inherit;
font-size: initial;
font-size: unset;

Example 4: how to change text size in css

.class{
  	font-size: 100%;
}

.class{
  	font-size: 20em;
}

.class{
  	font-size: 20px;
}

.class{
  	font-size: 20pt:
}

Tags:

Css Example