Change the Font in CSS3

Change the Font in CSS3

To change the font in CSS3 for your HTML text, we Can use the Font-family property. We can specify a font by name. Because not all fonts are available on all compute, we can designate a second or third font choice that way if the computer does not have the first choice installed, the browser tries to display the next choice instead.

For the best result, assign multiple font choices and be sure to include a common font, such as Arial, Verdana, Courier, or Time New Roman

Change the Font in CSS3

Step 1: Click inside the tag declaration and type font-family:.

Step 2:- Type a space and type the name of the font you want to use.

Step 3: To designate a second font choice, type a comma, a space, and the second font name.

Result Output

<!DOCTYPE html>
<html>
    <Head>
        <Title>Coding thai</Title>
        <style>
            p{
                font-family: arial;
            }
        </style>
    </Head>
    <body>
        <h1>Types of Web Developer</h1> 
        <hr>
        <Section class="First">
            <p> A front end developer has one general responsibility: to ensure
              that website visitors can easily interact with the page.
                and Back-end developers are the experts who build and maintain
              the mechanisms that process data and perform actions on websites.</p>
        </Section>
        <hr>
       <small> &copy;Copyright 2022 Codingthai</small>
    </body>
</html>

If the font name includes a space, surround the name in quotes.

Note: the web browser uses the assigned font for any text to which the tag is applied.

In this example, the style rules are applied to the <body>< tag, so all the body text is affected.

Can I apply multiple style settings to my fonts at the same time?

Yes, we can write a style rule that combines several font settings at the same time using font property. For example, we can designate the font, font size, and font style for a particular tag instead of writing three different rules for the tag. We can combine rules that might look like this:

p{ font : italic 12pt ” Tiome new Roman:, Arial}

Some browsers may require you to type the properties in a particular order, such as font style before font size.

What are serifs?

Serifs are small decorations that appear at the ends of some letters. Fonts can be classified by whether or not they include serifs. Common serifed fonts include Time New Roman

Follow us on Social Media For More

FacebookInstagramPinterest

Leave a Comment