A newbie here, working on his first site…am trying to use the source code of a site I like, to learn and design but am unable to see how the HTML and the CSS for the page work together…i saved the CSS in a local file and used href to include it in the HTML but the page is rendered without any styling in the browser when i preview…can someone tell me how i need to look at this properly - the site is www.coffeecup.com? (i’ve included the sample original code and my changes below)…
The first question is: where is the page that’s calling these styles located? If it’s not in the “Website” folder, then that will be a problem.
I’m not familar with Windows file paths, either, so I can’t tell if that’s a valid path or not. What does the path to your page file look like? Is that path above actually what you see in your browser address bar for the CSS file?
That normally doesn’t work on desktop, as that’s probably not the real absolute path. You can only really use absolute paths on your desktop if you are using a local server environment like XAMMP. (Well worth checking out, because you can set your site up with the same absolute paths on your desktop as online, meaning you don’t have to change anything when you upload. You can also run PHP etc.)
You’re welcome. I haven’t used XAMPP because I’m on a Mac, which uses MAMP instead. But another handy thing to know about to make the experience even better is to learn how to set up “virtual hosts”, so that your URLs can be exactly the same in XAMPP and online. Here is a post that may help: