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 CSS Foundations Getting Started with CSS Adding CSS to a Page

Carson Clark
Carson Clark
2,159 Points

"Are internal styles required to be downloaded by the browser each time a page loads?"

Do CSS and HTML files get downloaded? I thought they were just displayed for the clients in the browser? What is this question referring to? I know what internal styles are, but is this questions suggesting that external styling doesn't need to be "downloaded"? What does it mean by downloaded?

Thanks :)

2 Answers

Internal Style Sheets are tags in the HTML page and within the <head></head> tags are <style></style> tags that have to be downloaded each time you load the page. apparently not cache and / or available for offline use. Im sure there is a code out there to be added to HTML 5, but for this question. Yes, Internal Style Sheets are required to load each time.

       <head>
            <style>
                     p {
                        color: red; }
            </style>
       </head>
</html>```

External style sheets only need to be downloaded once when the web site first loads, after that the memory is saved as cache in the browser.
``` <head>
         <link rel="stylesheet" href="/css/main.css" type="text/css">
<head>```
 this <link rel> code calls a requests to the file within a directory of local file or http: link. to a css file ( Style sheet only.) one time. You are creating the style in a separate file .css  and the browser saves that external style sheet in browser, until you clear your cache.
Carson Clark
Carson Clark
2,159 Points

Thanks this is very clear. I'm still confused about the general concept of how everything loads, but I'll learn more as I dive into PHP/JavaScript.

Before its displayed its downloaded ...

Carson Clark
Carson Clark
2,159 Points

Well then wouldn't every page be downloaded to our computer somewhere? I think I'm overthinking everything but I just want to be sure. Or do you mean downloaded to the browser?