Apply a style locally in CSS3

Apply a style locally in CSS3

We can apply a style to a single instance of the tag in your file using an HTML attribute. The Style attribute enables you to apply a style rule to a tag without having to define the rule separately in an internal or external style sheet.

A style applied locally overrides any style found or external or internal style sheets of the same tag. Applying style locally works best for one-time changes or for quickly testing a style on content. You should use the internal or external style sheets you plan to apply once

Apply a style locally

Step 1: Click in the tag for the element you want to change and type style=”?” replacing? with the properties and values, you want to assign.

Separate multiple property-value pairs with semicolons.

Step 2: Open the HTML5 document in the web browser.

Result output

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

Follow us on Social Media For More

FacebookInstagramPinterest

Leave a Comment