Compare larger and smaller keywords of the font-size to px based font size in HTML and CSS
Description
The following code shows how to compare larger and smaller keywords of the font-size to px based font size.
Example
<html>
<head>
<style rel='stylesheet' type='text/css'>
body {<!--from w w w . ja va2 s . co m-->
font-size: medium;
}
p#larger {
font-size: larger;
}
p#larger span {
font-size: 20px;
}
p#smaller {
font-size: smaller;
}
p#smaller span {
font-size: 12px;
}
span {
background: mistyrose;
}
</style>
</head>
<body>
<p id='larger'>
This font is 1.2 times the default font, or 20 pixels.<br />
<span>this is a test. </span>
</p>
<p id='smaller'>
This font is 1.2 smaller than the default size, or pixels.<br />
<span>this is a test. </span>
</p>
</body>
</html>
The code above generates the following result.
HTML CSS Tutorial Font Size
Compare all possible font size settings in ...
Compare font-size Properties in HTML and CS...
Compare font-size in HTML and CSS
Compare font size in pixel, point, inch, mm...
Compare seven different absolute size keywo...
Demonstrate that font-size larger is increm...
Demonstrate that font-size smaller is incre...
Set font-size to 0.75em; (25% smaller) in H...
Set font size to 120% for H1 in HTML and CS...
Set font size to 150% larger in HTML and CS...
Set font-size to 18px in HTML and CSS
Set font size to 1.2em in HTML and CSS
Set font-size to 1.5em; (50% larger) in HTM...
Set font size to 6em in HTML and CSS
Set font size to 80% smaller in HTML and CS...
Set font size to 90% for paragraph in HTML ...
Set font size to medium and larger in HTML ...
Set font size to small in HTML and CSS
Set font-size to smaller in HTML and CSS
Use calculation based font size in HTML and...
Compare all possible font size settings in ...
Compare font-size Properties in HTML and CS...
Compare font-size in HTML and CSS
Compare font size in pixel, point, inch, mm...
Compare larger and smaller keywords of the ...
Compare percentage font size in HTML and CS...Compare seven different absolute size keywo...
Demonstrate that font-size larger is increm...
Demonstrate that font-size smaller is incre...
Set font-size to 0.75em; (25% smaller) in H...
Set font size to 120% for H1 in HTML and CS...
Set font size to 150% larger in HTML and CS...
Set font-size to 18px in HTML and CSS
Set font size to 1.2em in HTML and CSS
Set font-size to 1.5em; (50% larger) in HTM...
Set font size to 6em in HTML and CSS
Set font size to 80% smaller in HTML and CS...
Set font size to 90% for paragraph in HTML ...
Set font size to medium and larger in HTML ...
Set font size to small in HTML and CSS
Set font-size to smaller in HTML and CSS
Use calculation based font size in HTML and...