简体   繁体   中英

CSS file works in Safari but not in Google Chrome or Firefox

When I open my index.html file in Safari, it shows everything, styled with my CSS file. When I open my index.html with Google Chrome, it appears to only show the HTML. I do not use webkits, and I only pair my HTML to my CSS using this in my head tag in my index.html file:

CSS:

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

Does anyone know how I can open this in Google Chrome so it uses my CSS file like Safari does?

Thanks in advance!

Try using

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

The rel tag should have some quotation marks and the type should be text/css for compatibility.

First clear cache of browser and disable some html/css validation extension.It will be sure that it will work. and just follow the css attachment syntax below. <link rel="stylesheet" type="text/css" href="stylesheet.css">

I had the same problem with updating CSS, try ctrl + f5 .

It also forces to reload the cache.

And if this is the problem, you can try to clear the cache in the browser.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM