/    Sign up×
Community /Pin to ProfileBookmark

[RESOLVED] HTML not applying external css?

Not sure what’s going on here, never ran into this problem before.
I locally built a test index.html page and linked it to an external css file and firefox quantum, firefox 56, edge, IE, opera are not displaying the css. I even dropped into my WAMP test bed and it still didn’t work.

OS: Win10

Browsers: Firefox Quantum
Firefox 56
Edge
IE
Opera

[CODE]
<!DOCTYPE html>
<html>
<head>
<meta http-equiv=”Content-Type” content=”text/html; charset=utf-8″ />
<link rel=”stylesheet” type=”text/css” href=”style.css”>
</head>

<body>
<h1>Clients</h1>
</body>
</html>
[/CODE]

[CODE]
h1
{
color: #CCCCCC;
font-size: 50px;
}
[/CODE]

to post a comment
HTML

5 Comments(s)

Copy linkTweet thisAlerts:
@NogDogFeb 05.2018 — ...linked it to an external css file...[/quote]

However, the code sample you provided is looking for it locally in the same directory as the HTML file:

[code=html]
<link rel="stylesheet" type="text/css" href="style.css">
[/code]

From your problem description, it seems that the href value should be something like "http://example.com/styles/style.css" (just a random example).

_
Copy linkTweet thisAlerts:
@RagingFredauthorFeb 05.2018 — Both files reside in the same directory, as this is for testing purposes. When in I pull the source code via a browser, I am able to click on the link to the css and it loads up.
Copy linkTweet thisAlerts:
@RagingFredauthorFeb 06.2018 — I'm thinking that it's something with win10. I just tried it on a Win7 machine with IE and chrome and it worked just fine.

Thank you. ?
Copy linkTweet thisAlerts:
@rootFeb 06.2018 — I am thinking either a typo or the file is not where you think it is in relation to the path you need to put in your source ref or the CSS file has an error in it and not rendering in the browser as valid rules.

One way to find out is to hit F12 and look at the errors.

The other is to pop your code in to a web page validator on the W3C site and see how many errors it throws up.
Copy linkTweet thisAlerts:
@RagingFredauthorFeb 07.2018 — <--Noob here. The file ended up with the wrong encoding.
×

Success!

Help @RagingFred spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.4,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,

tipper: @Samric24,
tipped: article
amount: 1000 SATS,
)...