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

CSS How to Make a Website Beginning HTML and CSS Add Style to the Page

Michael Plemmons
Michael Plemmons
9,393 Points

Html5 CSS3

I bought a book on HTML5 and CSS3. In the book it shows CSS3 as a separate file, not included in the HTML file. The video shows CSS included in the HTML file. Is this still the correct way to do it or are you going to show the latest trend, like the switchover from HTML to HTML5 which breaks up the CSS3 into another file?

7 Answers

You will always want to keep your CSS code external and link to them within your html, this is the best way to keep organized code, and have the ability to use one CSS sheet to style many html sheets if you choose to do so; same goes forJavaScript.

Hi Michael! This is just for understanding the idea. Soon you'll see the development os CSS in separated files. ;)

Caleb Kleveter
MOD
Caleb Kleveter
Treehouse Moderator 37,862 Points

The reason Nick puts the CSS in the HTML file is to help explain it without making things to complicated, when you actually work on a project you put the CSS in a different file.

Also I'm not sure what book you picked up for html, but one of the best books I've seen that covers HTML5 & CSS3 is called (HTML & CSS Design and Build Websites by Jon Duckett) ISBN 978-1-118-00818-8.

Cheers!

Michael Plemmons
Michael Plemmons
9,393 Points

alright cool. thank you guys for your response. I love these classes. More explanatory and easier to follow than the book I have.

hahahaha. Books are really interesting after getting "real" explanations from a professional. Soon you'll profit your book well.

Michael Plemmons
Michael Plemmons
9,393 Points

Yeah mainly using it now as a reference guide but it's Murach's Crash course in HTML5 and CSS3.