Explain the three main ways to apply CSS styles to a web page

Technology CommunityCategory: CSSExplain the three main ways to apply CSS styles to a web page
VietMX Staff asked 3 years ago

Using the inline style attribute on an element

<div>
    <p style="color: maroon;"></p>
</div>

Using a <style> block in the <head> section of your HTML

<head>
    <title>CSS Refresher</title>
    <style>
        body {
            font-family: sans-serif;
            font-size: 1.2em;
        }
    </style>
</head>

Loading an external CSS file using the <link> tag

<head>
    <title>CSS Refresher</title>
    <link rel="stylesheet" href="/css/styles.css" />
</head>