Anastasie Laurent
Anastasie Laurent

Reputation: 915

css is not loaded on IE when the css in the body

I have a case that I want the css to be in the body not in the header, because the header is for all pages and each page have a different css file.

I have a problem that the style is working on chrome and firefox but it is not working on IE11.

I tried to use F12 to debug the problem and I discovered the problem.

when I click on the div class=waitingTime" on IE 11, the style is not appeear on the right view.

but when I do the same thing on chrome and firefox, the style is appears on right.

IE 11

enter image description here

Chrome

enter image description here

you can see that the code of adding the css file is above the div

Update

For people who can't see the images, I upload them here http://postimg.org/image/dd2p19gkh/

http://postimg.org/image/c5a0dntvn/

Update 2

this is how I add the css

<link href="http://localhost:8082/ParkingProject/public/css/waitingTimes" rel="stylesheet" type="text/css" media="all">
<div class="waitingTime">
</div>

Upvotes: 0

Views: 141

Answers (2)

Anastasie Laurent
Anastasie Laurent

Reputation: 915

Finally I found the problem

The file is waitingTime.css but I forgot to say .css

chrome and firefox so clever to udnerstand it but IE is stupid :) so when I added .css it works

Upvotes: 0

GolezTrol
GolezTrol

Reputation: 116100

You can use link tags in the body (only in HTML5) documents, but only when they have an itemprop attribute, not when they have a rel attribute.

So, your HTML is invalid. It's very nice of Chrome that it accidentally processes your page correctly, but you cannot blame IE for not doing so.

See also Can I use <link> tags in the body of an HTML document?

Upvotes: 1

Related Questions