How to Change Text in CSS | Use of CSS With HTML

How to Change Text Size By CSS

Like Us on Facebook





If you want to change text size in your webpage then you will get here detailed information about it. This is the font property. Here you can change font family, bolness, size and the style of text.

Font-size property

The font size property sets the size of text.

Syntax

ElementSelector{

font-size:24px;

}

Example:

<html>

    <head>

        <style type="text/css">

            p{

                font-size:24px;

            }

        </style>

    </head>

    <body>

    <p>this is a paragraph.</p>

</body>

</html>





Font-weight Property

The font weight property sets the boldness of the text.

Syntax

ElementSelector{

font-weight:bold;

}

Example:

<html>

    <head>

        <style type="text/css">

            p{

                font-weight:bold;

            }

        </style>

    </head>

    <body>

    <p>this is a paragraph.</p>

</body>

</html>





Font-family Property

The font family of a text is set with the font-family property.

Syntax

p{

font-family:”Georgia”;

}

Example

<html>

    <head>

        <style type="text/css">

            p{

                font-family:"georgia";

            }

        </style>

    </head>

    <body>

    <p>this is a paragraph.</p>

</body>

</html>




Leave a Reply

Your email address will not be published. Required fields are marked *