Icons Audio & Video

Please Share On:

There are 58 free Audio & Video Font Awesome Icons. The table below shows the free font awesome Audio & Video icons:

audio-description

broadcast-tower

circle

closed-captioning

compress-alt

eject

expand-alt

fast-backward

file-audio

file-video

film

headphones

microphone-alt

microphone-slash

pause

pause-circle

photo-video

play-circle

podcast

redo

rss

step-backward

stop

stop-circle

sync-alt

undo

video

volume-mute

volume-up

backward

circle

closed-captioning

compress

compress-arrows-alt

expand

expand-arrows-alt

fast-forward

file-audio

file-video

forward

microphone

microphone-alt-slash

music

pause-circle

phone-volume

play

play-circle

random

redo-alt

rss-square

step-forward

stop-circle

sync

tv

undo-alt

volume-down

volume-off

youtube





You may be interested in the following topics:



Icons Arrows

Please Share On:

There are 113 free Font Awesome Arrow icons. The table below shows the free font awesome arrow icons:

angle-double-down

angle-double-right

angle-down

angle-right

arrow-alt-circle-down

arrow-alt-circle-left

arrow-alt-circle-right

arrow-alt-circle-up

arrow-circle-down

arrow-circle-right

arrow-down

arrow-right

arrows-alt-h

arrow-up

caret-left

caret-square-down

caret-square-left

caret-square-right

caret-square-up

caret-up

chart-line

chevron-circle-left

chevron-circle-up

chevron-left

chevron-up

cloud-upload-alt

compress-arrows-alt

exchange-alt

expand-arrows-alt

external-link-square-alt

hand-point-down

hand-pointer

hand-point-left

hand-point-right

hand-point-up

level-down-alt

location-arrow

long-arrow-alt-left

long-arrow-alt-up

play

recycle

redo-alt

reply-all

share

share-square

sign-out-alt

sort-alpha-down

sort-alpha-up

sort-amount-down

sort-amount-up

sort-down

sort-numeric-down-alt

sort-numeric-up-alt

sync

text-height

undo

upload

angle-double-left

angle-double-up

angle-left

angle-up

arrow-alt-circle-down

arrow-alt-circle-left

arrow-alt-circle-right

arrow-alt-circle-up

arrow-circle-left

arrow-circle-up

arrow-left

arrows-alt

arrows-alt-v

caret-down

caret-right

caret-square-down

caret-square-left

caret-square-right

caret-square-up

cart-arrow-down

chevron-circle-down

chevron-circle-right

chevron-down

chevron-right

cloud-download-alt

compress-alt

download

expand-alt

external-link-alt

hand-point-down

hand-pointer

hand-point-left

hand-point-right

hand-point-up

history

level-up-alt

long-arrow-alt-down

long-arrow-alt-right

mouse-pointer

random

redo

reply

retweet

share-square

sign-in-alt

sort

sort-alpha-down-alt

sort-alpha-up-alt

sort-amount-down-alt

sort-amount-up-alt

sort-numeric-down

sort-numeric-up

sort-up

sync-alt

text-width

undo-alt





You may interest in the following topics:



Icons Animals

Please Share On:

There are 16 free Font Awesome Animal icons. The table below shows the free font Awesome Animal icons:

cat

dog

dragon

feather-alt

frog

horse

kiwi-bird

paw

crow

dove

feather

fish

hippo

horse-head

otter

spider





You may be interested in the following topics:



Icons Alert

Please Share On:

There are 10 free Font Awesome Alert icons The table below shows the free font Awesome Alert icons:

bell

bell-slash

exclamation

exclamation-triangle

radiation-alt

bell

bell-slash

exclamation-circle

radiation

skull-crossbones





You may be interested in the following topics:



Icons Accessibility

Please Share On:

There are 17 free Font Awesome Accessibility icons. The table below shows the free font Awesome Accessibility icons:

accessible-icon


assistive-listening-systems

blind

closed-captioning

deaf

phone-volume

question-circle

tty

wheelchair

american-sign-language-interpreting



audio-description

braille

closed-captioning

low-vision

question-circle

sign-language

universal-access





You may be interested in the following topics:

CSS Lists

Please Share On:

Definition:

CSS lists are used to organize your list items either in unordered lists or ordered lists. See the example of unordered lists and ordered lists in the below table.

Unordered ListsOrdered Lists
Banana
Orange
Mango
Apple
1. Banana
2. Orange
3. Mango
4. Apple
♡ Banana
♡ Orange
♡ Mango
♡ Apple
i. Banana
ii. Orange
iii. Mango
iv. Apple

CSS Lists (All Properties)

CSS Lists (All Properties)
1. list-style-type
2. list-style-position
3. list-style-image
4. list-style

1. list-style-type

See the below syntax of list-style-type in the Unordered and Ordered list. list-style-tyle: none property is used to remove the predefined default settings of list bullets/numbers.

Syntax:

Unordered Lists:
1. list-style-type: circle;
2. list-style-type: disc;
3. list-style-type: square;
Ordered Lists:
1. list-style-type: armenian;
2. list-style-type: cjk-ideographic;
3. list-style-type: decimal;
4. list-style-type: decimal-leading-zero;
5. list-style-type: georgian;
6. list-style-type: hebrew;
7. list-style-type: hiragana;
8. list-style-type: hiragana-iroha;
9. list-style-type: katakana;
10. list-style-type: katakana-iroha;
11. list-style-type: lower-alpha;
12. list-style-type: lower-greek;
13. list-style-type: lower-latin;
14. list-style-type: lower-roman;
15. list-style-type: upper-alpha;
16. list-style-type: upper-latin;
17. list-style-type: upper-roman;
18. list-style-type: none;
19. list-style-type: inherit;


Unordered Lists Source Code:

<!DOCTYPE html>
<html>
<head>
<style>
ul.circle {list-style-type: circle;}
ul.disc {list-style-type: disc;}
ul.square {list-style-type: square;}
</style>
</head>

<body>
<p>Unordered lists:</p>
<ul class="circle">
  <li>Banana</li>
  <li>Orange</li>
  <li>Mango</li>
  <li>Apple</li>
</ul>

<ul class="disc">
  <li>Banana</li>
  <li>Orange</li>
  <li>Mango</li>
  <li>Apple</li>
</ul>

<ul class="square">
  <li>Banana</li>
  <li>Orange</li>
  <li>Mango</li>
  <li>Apple</li>
</ul>
</body>
</html>

Unordered Lists Output:



Ordered Lists Source Code:

<!DOCTYPE html>
<html>
<head>
<style>
ol.armenian {list-style-type: armenian;}
ol.cjk-ideographic {list-style-type: cjk-ideographic;}
ol.decimal {list-style-type: decimal;}
ol.decimal-leading-zero {list-style-type: decimal-leading-zero;}
ol.georgian {list-style-type: georgian;}
ol.hebrew {list-style-type: hebrew;}
ol.hiragana {list-style-type: hiragana;}
ol.hiragana-iroha {list-style-type: hiragana-iroha;}
ol.katakana {list-style-type: katakana;}
ol.katakana-iroha {list-style-type: katakana-iroha;}
ol.lower-alpha {list-style-type: lower-alpha;}
ol.lower-greek {list-style-type: lower-greek;}
ol.lower-latin {list-style-type: lower-latin;}
ol.lower-roman {list-style-type: lower-roman;}
ol.upper-alpha {list-style-type: upper-alpha;}
ol.upper-latin {list-style-type: upper-latin;}
ol.upper-roman {list-style-type: upper-roman;}
ol.none {list-style-type: none;}
ol.inherit {list-style-type: inherit;}
</style>
</head>

<body>
<p> Ordered Lists:</p>
<b> 1. armenian</b>
<ol class="armenian">
  <li>Banana</li>
  <li>Orange</li>
  <li>Mango</li>
  <li>Apple</li>
</ol>

<ol class="cjk-ideographic">
<b> 2. cjk-ideographic</b>
  <li>Banana</li>
  <li>Orange</li>
  <li>Mango</li>
  <li>Apple</li>
</ol>

<ol class="decimal">
<b> 3. decimal</b>
  <li>Banana</li>
  <li>Orange</li>
  <li>Mango</li>
  <li>Apple</li>
</ol>

<ol class="decimal-leading-zero">
<b> 4. decimal-leading-zero</b>
  <li>Banana</li>
  <li>Orange</li>
  <li>Mango</li>
  <li>Apple</li>
</ol>

<ol class="georgian">
<b> 5. georgian</b>
  <li>Banana</li>
  <li>Orange</li>
  <li>Mango</li>
  <li>Apple</li>
</ol>

<ol class="hebrew">
<b> 6. hebrew</b>
  <li>Banana</li>
  <li>Orange</li>
  <li>Mango</li>
  <li>Apple</li>
</ol>

<ol class="hiragana">
<b> 7. hiragana</b>
  <li>Banana</li>
  <li>Orange</li>
  <li>Mango</li>
  <li>Apple</li>
</ol>

<ol class="hiragana-iroha">
<b> 8. hiragana-iroha</b>
  <li>Banana</li>
  <li>Orange</li>
  <li>Mango</li>
  <li>Apple</li>
</ol>

<ol class="katakana">
<b> 9. katakana</b>
  <li>Banana</li>
  <li>Orange</li>
  <li>Mango</li>
  <li>Apple</li>
</ol>

<ol class="katakana-iroha">
<b> 10. katakana-iroha</b>
  <li>Banana</li>
  <li>Orange</li>
  <li>Mango</li>
  <li>Apple</li>
</ol>

<ol class="lower-alpha">
<b> 11. lower-alpha</b>
  <li>Banana</li>
  <li>Orange</li>
  <li>Mango</li>
  <li>Apple</li>
</ol>

<ol class="lower-greek">
<b> 12. lower-greek</b>
  <li>Banana</li>
  <li>Orange</li>
  <li>Mango</li>
  <li>Apple</li>
</ol>

<ol class="lower-latin">
<b> 13. lower-latin</b>
  <li>Banana</li>
  <li>Orange</li>
  <li>Mango</li>
  <li>Apple</li>
</ol>

<ol class="lower-roman">
<b> 14. lower-roman</b>
  <li>Banana</li>
  <li>Orange</li>
  <li>Mango</li>
  <li>Apple</li>
</ol>

<ol class="upper-alpha">
<b> 15. upper-alpha</b>
  <li>Banana</li>
  <li>Orange</li>
  <li>Mango</li>
  <li>Apple</li>
</ol>

<ol class="upper-latin">
<b> 16. upper-latin</b>
  <li>Banana</li>
  <li>Orange</li>
  <li>Mango</li>
  <li>Apple</li>
</ol>

<ol class="upper-roman">
<b> 17. upper-roman</b>
  <li>Banana</li>
  <li>Orange</li>
  <li>Mango</li>
  <li>Apple</li>
</ol>

<ol class="none">
<b> 18. none</b>
  <li>Banana</li>
  <li>Orange</li>
  <li>Mango</li>
  <li>Apple</li>
</ol>

<ol class="inherit">
<b> 19. inherit</b>
  <li>Banana</li>
  <li>Orange</li>
  <li>Mango</li>
  <li>Apple</li>
</ol>
</body>
</html>

Ordered Lists Output:



2. list-style-position:

list-style-position property specifies the position of lists. The lists of bullets/numbers can be outside the list item or inside the list items. See the below example of using list-item-position.

Source Code:

<!DOCTYPE html>
<html>
<head>
<style>
ul.inside {
list-style-position: inside;
}

ul.outside {
list-style-position: outside;
}
</style>
</head>
 
<body>
<p><b>Inside list position:</b></p>
<ul class="inside">
  <li>Banana</li>
  <li>Orange</li>
  <li>Mango</li>
  <li>Apple</li>
</ul>
 
<p><b>Outside list position:</b></p>
<ul class="outside">
  <li>Banana</li>
  <li>Orange</li>
  <li>Mango</li>
  <li>Apple</li>
</ul>
</body>
</html>

Output:



3. list-style-image:

If you want to use your own custom image list items then you can use the list-style-image property. See the source code below for using your own custom image list items.

Source Code:

<!DOCTYPE html>
<html>
<head>
<style>
.list-style-image{
  list-style-image: url('https://www.elsebazaar.com/blog/wp-content/uploads/2020/07/heart30x30.jpg');
  list-style-position: inside; 
}
</style>
</head>

<body>
<ul class="list-style-image">
  <li>Banana</li>
  <li>Orange</li>
  <li>Mango</li>
  <li>Apple</li>
</ul>
</body>
</html>

Output:



4. list-style: Shorthand Property

list-style property is a shorthand property, where you declare all list-style properties. Let’s see the below example.

Source Code:

<!DOCTYPE html>
<html>
<head>
<style>
.list-style1{
  list-style: circle inside;
}
</style>
</head>

<body>
<ul class="list-style1">
  <li>Banana</li>
  <li>Orange</li>
  <li>Mango</li>
  <li>Apple</li>
</ul>
</body>
</html>

Output:




CSS Links

Please Share On:

Definition:

CSS links indicate that the blue color text has a link that opens another page upon clicking on it. The link text can be styled in different states such as:

  1. link – normal, unvisited link
  2. visited – already visited the link
  3. hover – link on mouse over it
  4. active – a link that is just clicked

Source Code:

<!DOCTYPE html>
<html>
<head>
<style>

.css-links:link {
  color: blue; /*unvisited link*/
}

.css-links:visited {
  color: green; /*visited link*/
}

.css-links:hover {
  color: red; /*mouse over link*/
}

.css-links:active {
  color: orange; /*selected link*/
}
</style>
</head>

<body>
<p><b><a class = "css-links" href="https://www.elsebazaar.com/blog/css-tutorial/" target="_blank">Put your mouse over to check on different link states</a></b>
</body>
</html>

Output:

Put your mouse over to check on different link states

Output Sample

unvisited link
visited link
mouse over it
selected link


CSS Icons

Please Share On:

Definition:

CSS Icons play an important role in your webpage which makes your web page look more professional and elegant. It is very easy to use CSS Icons on your web page from icon libraries like Font Awesome Icons, Bootstrap Icons, or Google Icons.

Let’s see each CSS icon uses with examples.

1) Font Awesome Icons

You can use the font-awesome icons with a single code. The step is pretty simple and easy. First of all, you need to visit the Font Awesome Icons Site which is www.fontawesome.com, create an account, and get a code of the icons you need to use. Apply the font awesome code in the header section

<link rel="stylesheet" href="https://use.fontawesome.com/releases/v5.0.7/css/all.css">

and your icons where ever you needed.

<i class="fa fa-user" aria-hidden="true"></i>
<i class="fa fa-thumbs-up" aria-hidden="true"></i>

Source Code:

<!DOCTYPE html>
<html>
<head>
<link rel="stylesheet" href="https://use.fontawesome.com/releases/v5.0.7/css/all.css">
</head>
<body>

<i class="fa fa-calculator" aria-hidden="true"></i>
<i class="fa fa-bus" aria-hidden="true"></i>
<i class="fa fa-comment" aria-hidden="true"></i>
<i class="fa fa-user" aria-hidden="true"></i>
<i class="fa fa-tags" aria-hidden="true"></i>
<i class="fa fa-thumbs-up" aria-hidden="true"></i>

</body>
</html>

Output:

Here, you will see the list of available Font Awesome Icons.



2) Bootstrap Icons

Like Font Awesome Icons, you need to add a bootstrap Icons script into the head section of your page.

<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap-icons@1.5.0/font/bootstrap-icons.css">

and the icon’s code wherever you needed.

<i class="bi bi-search"></i>
    <i class="bi bi-check-circle"></i>
    <i class="bi bi-x-diamond"></i>
    <i class="bi bi-book"></i>
    <i class="bi bi-calendar-day"></i>

Source Code:

<!DOCTYPE html>
<html>
<head>
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap-icons@1.5.0/font/bootstrap-icons.css">
</head>
<body>

    <i class="bi bi-search"></i>
    <i class="bi bi-check-circle"></i>
    <i class="bi bi-x-diamond"></i>
    <i class="bi bi-book"></i>
    <i class="bi bi-calendar-day"></i>

</body>
</html>

Output:

Here, you will see the list of available Bootstrap Icons.



3) Google Icons

To use Google icons on your webpage, use the Google icons script inside your Html <head>.

<link rel="stylesheet" href="https://fonts.googleapis.com/icon?family=Material+Icons">

and use your Google icons wherever you needed.

<i class="material-icons">backup</i>
<i class="material-icons">home</i>

Source Code:

<!DOCTYPE html>
<html>
<head>
<link rel="stylesheet" href="https://fonts.googleapis.com/icon?family=Material+Icons">
</head>

<body>
<i class="material-icons">assignment_ind</i>
<i class="material-icons">backup</i>
<i class="material-icons">highlight_off</i>
<i class="material-icons">home</i>
<i class="material-icons">info</i>
</body>
</html>

Output:

Here, you will see the list of available Google Icons.



CSS Font Style

Please Share On:

Definition:

CSS font-style is used to style the text. It can be normal, italic and oblique.

Syntax:

font-style: normal | italic | oblique

Property Value:

- Normal
- Italic
- Oblique

1. font-style: normal

Definition:

font-style: normal specify the normal text. This is the default font. This font is used if you have previously defined font-style in italic or oblique and want to change back to normal font-style.

Source Code:

<!DOCTYPE html>
<html>
  <head>
    <style>
    .italic{
      border: 3px solid black;
      background-color: pink;  
      font-style: italic;
    }

    .normal{
      border: 3px solid black;
      background-color: pink;  
      font-style: normal;
    }
    </style>
  </head>

  <body>
    <p class="italic">Previously, the font is defined in italic.</p>
    <p class="normal">Here, the font is in normal style.</p>
  </body>
</html>

Output:

font-style:normal;

2. font-style: italic

Definition:

font-style: italic specify the italic text.

Source Code:

<!DOCTYPE html>
<html>
  <head>
    <style>
    .italic{
      border: 3px solid black;
      background-color: pink;  
      font-style: italic;
    }
    </style>
  </head>

  <body>
  	<p class="italic">Here, the font is defined in italic.</p>
  </body>
</html>

Output:

font-sytle:italic;



3. font-style: oblique

Definition:

font-style: oblique specified the leaning text, which is pretty much similar to italic text. See the below source code and output.

Source Code:

<!DOCTYPE html>
<html>
  <head>
    <style>
    .oblique{
      border: 3px solid black;
      background-color: pink;  
      font-style: oblique;
    }
    </style>
  </head>

  <body>
  	<p class="oblique">Here, the font is defined in oblique.</p>
  </body>
</html>

Output:

font-style: oblique;


Donate to support writers


You may be interested in the following topics:

CSS Font Size

Please Share On:

Definition:

CSS Font size is used to set the font size of your browser. The default text size in the browser is 16 px. 1 em is equal to your current text size. Here, 1 em = 16 px. If your default text size is 25 px then 1 em = 25 px.

Syntax:

font-size: smaller | xx-small | x-small | small | medium | large | x-large | xx-large | larger | length | % | initial | inherit;

Property Value:

Property ValueDescription
1. smallerset the font-size smaller than its parent size
2. xx-smallset the font-size to an xx-small size
3. x-smallset the font-size to an x-small size
4. smallset the font-size to an small size
5. mediumset the font-size to medium size. This is a default font-size.
6. largeset the font-size to a large size
7. x-largeset the font-size to an extra-large size
8. xx-largeset the font-size to a double extra large size
9. largerset the font-size to a larger size than its parent size
10. lengthset the font-size in a fixed size defined by px, em, in, etc.
11. %set the font-size to a percentage value.
12. initialset the font-size to its default value.
13. inheritInherit the font-size to its parent value.

Scroll down to see each font-size output with example.

1. smaller

Definition:

It sets the font size smaller than its parent size

Source Code:

<!DOCTYPE html>
<html>
  <head>
    <style>
    .default {
      border: 3px solid black;
      background-color: pink;
    }

    .smaller {
      border: 3px solid black;
      background-color: pink;
      font-size: smaller;
    }
    </style>
  </head>

  <body>
    <div class="default">This is a paragraph with a default font size.</div>
    <div class="smaller">This is a paragraph with a smaller font size.</div>
  </body>
</html>

Output:

font-size: smaller;

2. xx-small

Definition:

It sets the font size to xx-small size.

Source Code:

<!DOCTYPE html>
<html>
  <head>
    <style>
    .default {
      border: 3px solid black;
      background-color: pink;
    }

    .xx-small {
      border: 3px solid black;
      background-color: pink;
      font-size: xx-small;
    }
    </style>
  </head>

  <body>
    <div class="default">This is a paragraph with a default font size.</div>
    <div class="xx-small">This is a paragraph with a xx-small font size.</div>
  </body>
</html>

Output:

font-size: xx-small;



3. x-small

Definition:

It sets the font size to x-small size.

Source Code:

<!DOCTYPE html>
<html>
  <head>
    <style>
    .default {
      border: 3px solid black;
      background-color: pink;
    }

    .x-small {
      border: 3px solid black;
      background-color: pink;
      font-size: x-small;
    }
    </style>
  </head>

  <body>
    <div class="default">This is a paragraph with a default font size.</div>
    <div class="x-small">This is a paragraph with a x-small font size.</div>
  </body>
</html>

Output:

font-size: x-small;

4. small

Definition:

It sets the font size to a small size.

Source Code:

<!DOCTYPE html>
<html>
  <head>
    <style>
    .default {
      border: 3px solid black;
      background-color: pink;
    }

    .small {
      border: 3px solid black;
      background-color: pink;
      font-size: small;
    }
    </style>
  </head>

  <body>
    <div class="default">This is a paragraph with a default font size.</div>
    <div class="small">This is a paragraph with a small font size.</div>
  </body>
</html>

Output:

font-size: small;

5. medium

Definition:

It sets the font size to medium size. This is a default font size.

Source Code:

<!DOCTYPE html>
<html>
  <head>
    <style>
    .default {
      border: 3px solid black;
      background-color: pink;
    }

    .medium {
      border: 3px solid black;
      background-color: pink;
      font-size: medium;
    }
    </style>
  </head>

  <body>
    <div class="default">This is a paragraph with a default font size.</div>
    <div class="medium">This is a paragraph with a medium font size.</div>
  </body>
</html>

Output:

font-size: medium;



6. large

Definition:

It sets the font size to a large size.

Source Code:

<!DOCTYPE html>
<html>
  <head>
    <style>
    .default {
      border: 3px solid black;
      background-color: pink;
    }

    .large {
      border: 3px solid black;
      background-color: pink;
      font-size: large;
    }
    </style>
  </head>

  <body>
    <div class="default">This is a paragraph with a default font size.</div>
    <div class="large">This is a paragraph with a large font size.</div>
  </body>
</html>

Output:

font-size: large;


7. x-large

Definition:

It sets the font size to extra-large size.

Source Code:

<!DOCTYPE html>
<html>
  <head>
    <style>
    .default {
      border: 3px solid black;
      background-color: pink;
    }

    .x-large {
      border: 3px solid black;
      background-color: pink;
      font-size: x-large;
    }
    </style>
  </head>

  <body>
    <div class="default">This is a paragraph with a default font size.</div>
    <div class="x-large">This is a paragraph with an extra large font size.</div>
  </body>
</html>

Output:

font-size: x-large;


8. xx-large

Definition:

It sets the font size to double the extra-large size.

Source Code:

<!DOCTYPE html>
<html>
  <head>
    <style>
    .default {
      border: 3px solid black;
      background-color: pink;
    }

    .xx-large {
      border: 3px solid black;
      background-color: pink;
      font-size: xx-large;
    }
    </style>
  </head>

  <body>
    <div class="default">This is a paragraph with a default font size.</div>
    <div class="xx-large">This is a paragraph with a double extra large font size.</div>
  </body>
</html>

Output:

font-size: xx-large;


9. larger

Definition:

It sets the font size to a larger size than its parent size

Source Code:

<!DOCTYPE html>
<html>
  <head>
    <style>
    .default {
      border: 3px solid black;
      background-color: pink;
    }

    .larger {
      border: 3px solid black;
      background-color: pink;
      font-size: larger;
    }
    </style>
  </head>

  <body>
    <div class="default">This is a paragraph with a default font size.</div>
    <div class="larger">This is a paragraph with a larger font size.</div>
  </body>
</html>

Output:

font-size: larger;


10. length

Definition:

It sets the font size in a fixed size defined by px, em, in, etc.

Source Code:

<!DOCTYPE html>
<html>
  <head>
    <style>
    .default {
      border: 3px solid black;
      background-color: pink;
    }

    .px {
      border: 3px solid black;
      background-color: pink;
      font-size: 15px;
    }

    .em {
      border: 3px solid black;
      background-color: pink;
      font-size: 2em;
    }

    .in {
      border: 3px solid black;
      background-color: pink;
      font-size: 0.2in;
    }
    </style>
  </head>

  <body>
    <div class="default">This is a paragraph with a default font size.</div>
    <div class="px">This is a paragraph with a 15px font size.</div>
    <div class="em">This is a paragraph with a 2em font size.</div>
    <div class="in">This is a paragraph with a 0.2in font size.</div>
  </body>
</html>

Output:

font-size: 2em;


11. %

Definition:

It sets the font size to a percentage value.

Source Code:

<!DOCTYPE html>
<html>
  <head>
    <style>
    .default {
      border: 3px solid black;
      background-color: pink;
    }

    .percentage{
      border: 3px solid black;
      background-color: pink;
      font-size: 50%;
    }
    </style>
  </head>

  <body>
    <div class="default">This is a paragraph with a default font size.</div>
    <div class="percentage">This is a paragraph defined in a 50% percentage font size.</div>
  </body>
</html>

Output:

font-size :50%;



12. initial

Definition:

It sets the font size to its default value.

Source Code:

<!DOCTYPE html>
<html>
  <head>
    <style>
    .default {
      border: 3px solid black;
      background-color: pink;
    }

    .initial{
      border: 3px solid black;
      background-color: pink;
      font-size: initial;
    }
    </style>
  </head>

  <body>
    <div class="default">This is a paragraph with a default font size.</div>
    <div class="initial">This is a paragraph set the font-size to its initial default value.</div>
  </body>
</html>

Output:

font-size: initial;


13. inherit

Definition:

It inherits the font size of its parent value.

Source Code:

<!DOCTYPE html>
<html>
  <head>
    <style>
    .default {
      border: 3px solid black;
      background-color: pink;
    }

    .inherit{
      border: 3px solid black;
      background-color: pink;
      font-size: inherit;
    }
    </style>
  </head>

  <body>
    <div class="default">This is a paragraph with a default font size.</div>
    <div class="inherit">This is a paragraph set the font-size inherit to its parent value.</div>
  </body>
</html>

Output:

font-size: inherit;


Donate to support writers


You may be interested in the following topics:

Copyright @2023. All Right Reserved.


Social media & sharing icons powered by UltimatelySocial