Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

HTML How to Make a Website Creating HTML Content Include External CSS

Archil Mestvirishvili
Archil Mestvirishvili
2,839 Points

css link

months ago i've learned a different type to link css with index.html your way to workspace is <link rel="stylesheet" href="css/normalize.css"> i've learned this way: <link rel="stylesheet" type="text/css" href="normalize.css" /> is it wrong?

1 Answer

I am not 100% sure what you are asking but if it is what I think it is, here goes.

There is more than one way to link CSS to an HTML file. The best way to do it is externally. If you want to link to an external CSS file, the code format is:

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

Be sure to replace "path_to_css" with the actual location of your css file.

You can also include your CSS in the HTML file or style your elements inline however, it is highly recommended that you keep your presentation and layout separate.

Archil Mestvirishvili
Archil Mestvirishvili
2,839 Points

You've covered my question! Thanks a alot!