This forum is now read-only. Please use our new forums at

CSS: An Overview Forum

View Course » View Exercise

154 points
Submitted by
about 5 years ago

Why use CSS and not just the html code we used before

why do you use css sheet when before we were just putting that code directly in with the html stuff, like why do you choose one way over the other?

4 votes


Inline styling (<p style="color: green;"></p>) can bloat out your code and are a nightmare to update if you have a lot of them.

External stylesheets (stylesheet.css) allow you to completely separate your CSS from your HTML everything is stored within a single file and once changed/updated, the changes are reflected on all other pages that reference the stylesheet.

This makes it easier to maintain larger websites and helps load pages quicker once the main CSS file has been cached and as a result bandwidth goes down.

effectively, you’re able to change the entire look and feel of a website through a single file.

The internal stylesheet (<style></style>) is placed within a page’s head tag and is intended to only modify the style of the page that includes it.

It's basically the mid point between the external and the inline styles. Like the inline the internal stylesheet is good when you need to make changes to a single document. Another good time to use this is when you only have to create one standalone page.There's no point in making a new css file for one page.

Hope that helps

288 points
Submitted by
martin smyth
about 5 years ago


F3f828442486663c9d8eafff9544b0a2?s=140&d=retro nathan buckley about 5 years ago

taaank you!

F3f828442486663c9d8eafff9544b0a2?s=140&d=retro nathan buckley about 5 years ago

taaank you!

0 votes


It's better to have a separate css file for maintenace. If you have 2 or 3 pages you can use inside css (with style), but if you work on a real website, let's say about 100 pages, how do you do that job in 1 hour?.
Answer adding a separate css file.

365 points
Submitted by
Tobias Páez
over 3 years ago