Reputation: 956
I have seen lots of websites importing css like
<link media="screen" rel="stylesheet" href="style.css" />
and some has
<link rel="stylesheet" href="style.css" />
I really wonder what does it makes the difference if we put media="screen" attribute the link element.
Upvotes: 2
Views: 122
Reputation: 2184
That stylesheet creates the styles for a printed version of the site, if you wanted a change in look when printed.
Upvotes: 0
Reputation: 11
Media type screen tells that the style.css should load only in case of screens like computer-screens, tablets, smart-phones, etc. The css will not load for print-preview or screen-readers.
Upvotes: 0
Reputation: 412
https://developer.mozilla.org/en-US/docs/Web/CSS/Media_Queries/Using_media_queries
Media queries determine when the styles should apply. It depends on what device or medium the user is viewing your content on.
Upvotes: 1
Reputation: 3811
It's a media query. This one in particular only uses that style sheet when viewed on a traditional screen (ie not a screen reader). More info on MDN.
Upvotes: 1
Reputation: 167172
There are multiple reasons:
screen
styles appear too.aural
(deprecated) or speech
.Check Using Media Queries for more information.
Upvotes: 3