CSS: An Overview
Link it up!

But there's an even better way.

You know you should write your CSS in a totally separate file. But how do you make sure your HTML file can see that CSS information?

You do this by putting a <link> tag (as you saw in the first exercise of this course) between the <head>...</head> tags of your HTML page. Your <link> tag needs three attributes:

  1. A type attribute that should always be equal to "text/css"
  2. A rel attribute that should always be equal to "stylesheet"
  3. A href attribute that should point to the web address of your CSS file

In the editor to the right, you'll see two files: index.html and stylesheet.css.


Insert a <link> to stylesheet.css in index.html. Check the Hint if you need help!

Stuck? Get a hint! Hint
Get live, fast support from Codecademy Advisors when you get stuck. Learn more.

The full syntax should look like this:

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

If you're getting a strange number for the font size (like 44.6363), try resetting your zoom with Ctrl-0 or Cmd-0.

View Preview