0

I'm using html and css for the first time. On one computer the html refers to the css appropriately, but on another the css is not referred to at all. I think I'm linking to the css correctly in the html:

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

On both computers, I'm using the latest version of Firefox.

Any thoughts as to where I'm going wrong?

Thanks in advance.

2
  • view ff soruce and click on css files path Commented Jul 21, 2013 at 0:18
  • Make sure to clear your browsing info when changing css. Sometimes browsers 'remember' what was there before your change and don't pickup on the new stuff. Sometimes even changing something in the html forces it to do a hard refresh. Commented Jul 21, 2013 at 0:22

1 Answer 1

4

Are you using your browser's developer tools?

Right click in Firefox and go to "Inspect".

Find the Web Console tab. There you will see if the reference to the css file is valid or if it returning a 404, not found.

Also, your reference should be href="/css/mystyle.css", to keep a clean root directory of the site.

Also, you might want to self close the tag:

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

And if that doesn't help, run your code through the w3c validator: http://validator.w3.org/

Sign up to request clarification or add additional context in comments.

3 Comments

Thanks for the quick reply, Stacey! When I inspect the page it says no css properties found. I cleaned up the reference and self closed the tag. The css is in the same directory as the html. Is there a way to use the w3 validator for files? This isn't a live website, just something I'm trying to build out at the moment.
@user2603227 the W3 CSS validator has options for upload and direct input (copy/paste) in addition to the url input.
@user2603227, 1. Check if the path you have is valid by visiting devsite.com/mystyle.css 2. Copy the source of your style sheet and paste it in to the W3c CSS validator and run the test.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.