</> Code Corner

CSS · CSS Tutorial · Lesson 4

CSS How To

External, internal and inline CSS, and cascading order.

There are three ways of inserting a style sheet: external, internal and inline.

Example

<!-- External -->
<link rel="stylesheet" href="mystyle.css">

<!-- Internal -->
<style>
  h1 { color: maroon; margin-left: 40px; }
</style>

<!-- Inline -->
<h1 style="color:blue;text-align:center;">Inline style</h1>

Cascading Order

When several styles apply, they "cascade" into one. Priority from highest to lowest:

Keep reading “CSS How To”

Sign up to read the full lesson (1 more parts), try every example in the live editor, and take the 5-question quiz.

Chat with us 👋