EXTERNAL CSS

AKASH E



External CSS

An external stylesheet is typically used when you want to make changes across multiple pages. It's ideal for this situation because it allows you to update the entire website's appearance by modifying just one file.

It uses the <link> tag on every page, and the <link> tag should be placed inside the <head> section.

Example

<head>
  <link rel="stylesheet" type="text/css" href="style.css">
</head>

The external stylesheet can be created in any text editor, but it must be saved with a .css extension. This file should not include any HTML elements.

Let's consider an example of a stylesheet file named "style.css".

File: style.css

body {
    background-color: blue;
}

h2 {
    color: navy;
    margin-left: 10px;
}

Note: There should be no space between the property value and the unit. For example, it should be margin-left: 10px, not margin-left: 10 px.
Tags
Our website uses cookies to enhance your experience. Learn More
Accept !

GocourseAI

close
send