Welcome to the Treehouse Community

The Treehouse Community is a meeting place for developers, designers, and programmers of all backgrounds and skill levels to get support. Collaborate here on code errors or bugs that you need feedback on, or asking for an extra set of eyes on your latest project. Join thousands of Treehouse students and alumni in the community today. (Note: Only Treehouse students can comment or ask questions, but non-students are welcome to browse our conversations.)

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and a supportive community. Start your free trial today.

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:

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

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!