Menu

Linking CSS to HTML

Linking CSS to HTML

CSS is what controls the visual styling of a page, like colors, fonts, and spacing. While CSS itself is a separate language, you connect it to your HTML using the link tag inside the head section.

This is called an external stylesheet, and it is the most common and recommended way to add CSS, since it keeps your structure and styling in separate files.

<head>

  <link rel="stylesheet" href="style.css">

</head>

Explanation: rel equals stylesheet tells the browser what kind of file this is. href points to the CSS file's location, just like it does for links. As soon as this line loads, any styles written in that file will apply to your HTML page.


HTML Tutorial (From Basics to Implementation)

AP

Abhishek Pati





Get in Touch For Details