can the link-tags media-attribute prevent css-files from being downloaded Announcing the arrival of Valued Associate #679: Cesar Manara Planned maintenance scheduled April 23, 2019 at 23:30 UTC (7:30pm US/Eastern) Data science time! April 2019 and salary with experience The Ask Question Wizard is Live!Is it possible to set the equivalent of a src attribute of an img tag in CSS?Element link is missing required attribute propertymedia screen and min-width 600px not workingThis stylesheet cannot be viewed because its source is in a different domain than the page - ie9Trying to understand @media queries in CSS fileDifference Between HTML LINK Media and CSS Media QueriesCannot display HTML stringMargin-top grows with smaller widthhref style rel - What is the right order when linking a CSS stylesheet to an HTML fileLink tag not working while linking a css file

How do I find out the mythology and history of my Fortress?

Can the Flaming Sphere spell be rammed into multiple Tiny creatures that are in the same 5-foot square?

How can I set the aperture on my DSLR when it's attached to a telescope instead of a lens?

What initially awakened the Balrog?

How could we fake a moon landing now?

Why do aircraft stall warning systems use angle-of-attack vanes rather than detecting airflow separation directly?

Why can't I install Tomboy in Ubuntu Mate 19.04?

Do I really need to have a message in a novel to appeal to readers?

How do living politicians protect their readily obtainable signatures from misuse?

The Nth Gryphon Number

What is the difference between a "ranged attack" and a "ranged weapon attack"?

Co-worker has annoying ringtone

Strange behavior of Object.defineProperty() in JavaScript

What is an "asse" in Elizabethan English?

Converted a Scalar function to a TVF function for parallel execution-Still running in Serial mode

How to run automated tests after each commit?

Amount of permutations on an NxNxN Rubik's Cube

How to compare two different files line by line in unix?

The test team as an enemy of development? And how can this be avoided?

Lagrange four-squares theorem --- deterministic complexity

What does this say in Elvish?

Most bit efficient text communication method?

How often does castling occur in grandmaster games?

Sum letters are not two different



can the link-tags media-attribute prevent css-files from being downloaded



Announcing the arrival of Valued Associate #679: Cesar Manara
Planned maintenance scheduled April 23, 2019 at 23:30 UTC (7:30pm US/Eastern)
Data science time! April 2019 and salary with experience
The Ask Question Wizard is Live!Is it possible to set the equivalent of a src attribute of an img tag in CSS?Element link is missing required attribute propertymedia screen and min-width 600px not workingThis stylesheet cannot be viewed because its source is in a different domain than the page - ie9Trying to understand @media queries in CSS fileDifference Between HTML LINK Media and CSS Media QueriesCannot display HTML stringMargin-top grows with smaller widthhref style rel - What is the right order when linking a CSS stylesheet to an HTML fileLink tag not working while linking a css file



.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty height:90px;width:728px;box-sizing:border-box;








-1















If I have a page with different css-files for different screen-sizes, like:



<html>
<head>
<title>Media Query Test</title>
<link rel="stylesheet" type="text/css" href="white.css">
<link rel="stylesheet" type="text/css" href="blue.css" media="(min-width: 640px)" defer />
<link rel="stylesheet" type="text/css" href="green.css" media="(min-width: 1000px)" defer />
<link rel="stylesheet" type="text/css" href="red.css" media="(min-width: 1400px)" defer />
<link rel="stylesheet" type="text/css" href="yellow.css" media="print" defer />
</head>
<body>
<h1>Media Query Test</h1>
</bdoy>
</html>


Why do my webbrowser download all of them, when i open it in a windows smaller then 640px.



Is it possible to prevent it from downloading the files it dosn't need?



live exemple: https://mq.puggan.se/mq/mq.php










share|improve this question

















  • 1





    This can be done by js only I guess, check the line

    – Abhishek Pandey
    Mar 22 at 11:09











  • Ah, they are non-blocking and low-prio, but still downloaded, according to: igvita.com/2012/06/14/…

    – Puggan Se
    Mar 22 at 11:22











  • The point is there is not clean way to do that, you need to make your hands dirty with js to achieve this.

    – Abhishek Pandey
    Mar 22 at 11:23







  • 1





    “Why do my webbrowser download all of them” - because it doesn’t want to show the visitor the “lag” that would otherwise occur, if they changed window dimensions or screen orientation, and the appropriate stylesheet started loading only then. In the worst case, they could see the elements completely un-styled for as long as the new stylesheet loads (if the other stylesheets did not apply at all for the current viewport dimensions.)

    – 04FS
    Mar 22 at 11:40


















-1















If I have a page with different css-files for different screen-sizes, like:



<html>
<head>
<title>Media Query Test</title>
<link rel="stylesheet" type="text/css" href="white.css">
<link rel="stylesheet" type="text/css" href="blue.css" media="(min-width: 640px)" defer />
<link rel="stylesheet" type="text/css" href="green.css" media="(min-width: 1000px)" defer />
<link rel="stylesheet" type="text/css" href="red.css" media="(min-width: 1400px)" defer />
<link rel="stylesheet" type="text/css" href="yellow.css" media="print" defer />
</head>
<body>
<h1>Media Query Test</h1>
</bdoy>
</html>


Why do my webbrowser download all of them, when i open it in a windows smaller then 640px.



Is it possible to prevent it from downloading the files it dosn't need?



live exemple: https://mq.puggan.se/mq/mq.php










share|improve this question

















  • 1





    This can be done by js only I guess, check the line

    – Abhishek Pandey
    Mar 22 at 11:09











  • Ah, they are non-blocking and low-prio, but still downloaded, according to: igvita.com/2012/06/14/…

    – Puggan Se
    Mar 22 at 11:22











  • The point is there is not clean way to do that, you need to make your hands dirty with js to achieve this.

    – Abhishek Pandey
    Mar 22 at 11:23







  • 1





    “Why do my webbrowser download all of them” - because it doesn’t want to show the visitor the “lag” that would otherwise occur, if they changed window dimensions or screen orientation, and the appropriate stylesheet started loading only then. In the worst case, they could see the elements completely un-styled for as long as the new stylesheet loads (if the other stylesheets did not apply at all for the current viewport dimensions.)

    – 04FS
    Mar 22 at 11:40














-1












-1








-1








If I have a page with different css-files for different screen-sizes, like:



<html>
<head>
<title>Media Query Test</title>
<link rel="stylesheet" type="text/css" href="white.css">
<link rel="stylesheet" type="text/css" href="blue.css" media="(min-width: 640px)" defer />
<link rel="stylesheet" type="text/css" href="green.css" media="(min-width: 1000px)" defer />
<link rel="stylesheet" type="text/css" href="red.css" media="(min-width: 1400px)" defer />
<link rel="stylesheet" type="text/css" href="yellow.css" media="print" defer />
</head>
<body>
<h1>Media Query Test</h1>
</bdoy>
</html>


Why do my webbrowser download all of them, when i open it in a windows smaller then 640px.



Is it possible to prevent it from downloading the files it dosn't need?



live exemple: https://mq.puggan.se/mq/mq.php










share|improve this question














If I have a page with different css-files for different screen-sizes, like:



<html>
<head>
<title>Media Query Test</title>
<link rel="stylesheet" type="text/css" href="white.css">
<link rel="stylesheet" type="text/css" href="blue.css" media="(min-width: 640px)" defer />
<link rel="stylesheet" type="text/css" href="green.css" media="(min-width: 1000px)" defer />
<link rel="stylesheet" type="text/css" href="red.css" media="(min-width: 1400px)" defer />
<link rel="stylesheet" type="text/css" href="yellow.css" media="print" defer />
</head>
<body>
<h1>Media Query Test</h1>
</bdoy>
</html>


Why do my webbrowser download all of them, when i open it in a windows smaller then 640px.



Is it possible to prevent it from downloading the files it dosn't need?



live exemple: https://mq.puggan.se/mq/mq.php







html css






share|improve this question













share|improve this question











share|improve this question




share|improve this question










asked Mar 22 at 11:01









Puggan SePuggan Se

4,90521642




4,90521642







  • 1





    This can be done by js only I guess, check the line

    – Abhishek Pandey
    Mar 22 at 11:09











  • Ah, they are non-blocking and low-prio, but still downloaded, according to: igvita.com/2012/06/14/…

    – Puggan Se
    Mar 22 at 11:22











  • The point is there is not clean way to do that, you need to make your hands dirty with js to achieve this.

    – Abhishek Pandey
    Mar 22 at 11:23







  • 1





    “Why do my webbrowser download all of them” - because it doesn’t want to show the visitor the “lag” that would otherwise occur, if they changed window dimensions or screen orientation, and the appropriate stylesheet started loading only then. In the worst case, they could see the elements completely un-styled for as long as the new stylesheet loads (if the other stylesheets did not apply at all for the current viewport dimensions.)

    – 04FS
    Mar 22 at 11:40













  • 1





    This can be done by js only I guess, check the line

    – Abhishek Pandey
    Mar 22 at 11:09











  • Ah, they are non-blocking and low-prio, but still downloaded, according to: igvita.com/2012/06/14/…

    – Puggan Se
    Mar 22 at 11:22











  • The point is there is not clean way to do that, you need to make your hands dirty with js to achieve this.

    – Abhishek Pandey
    Mar 22 at 11:23







  • 1





    “Why do my webbrowser download all of them” - because it doesn’t want to show the visitor the “lag” that would otherwise occur, if they changed window dimensions or screen orientation, and the appropriate stylesheet started loading only then. In the worst case, they could see the elements completely un-styled for as long as the new stylesheet loads (if the other stylesheets did not apply at all for the current viewport dimensions.)

    – 04FS
    Mar 22 at 11:40








1




1





This can be done by js only I guess, check the line

– Abhishek Pandey
Mar 22 at 11:09





This can be done by js only I guess, check the line

– Abhishek Pandey
Mar 22 at 11:09













Ah, they are non-blocking and low-prio, but still downloaded, according to: igvita.com/2012/06/14/…

– Puggan Se
Mar 22 at 11:22





Ah, they are non-blocking and low-prio, but still downloaded, according to: igvita.com/2012/06/14/…

– Puggan Se
Mar 22 at 11:22













The point is there is not clean way to do that, you need to make your hands dirty with js to achieve this.

– Abhishek Pandey
Mar 22 at 11:23






The point is there is not clean way to do that, you need to make your hands dirty with js to achieve this.

– Abhishek Pandey
Mar 22 at 11:23





1




1





“Why do my webbrowser download all of them” - because it doesn’t want to show the visitor the “lag” that would otherwise occur, if they changed window dimensions or screen orientation, and the appropriate stylesheet started loading only then. In the worst case, they could see the elements completely un-styled for as long as the new stylesheet loads (if the other stylesheets did not apply at all for the current viewport dimensions.)

– 04FS
Mar 22 at 11:40






“Why do my webbrowser download all of them” - because it doesn’t want to show the visitor the “lag” that would otherwise occur, if they changed window dimensions or screen orientation, and the appropriate stylesheet started loading only then. In the worst case, they could see the elements completely un-styled for as long as the new stylesheet loads (if the other stylesheets did not apply at all for the current viewport dimensions.)

– 04FS
Mar 22 at 11:40













0






active

oldest

votes












Your Answer






StackExchange.ifUsing("editor", function ()
StackExchange.using("externalEditor", function ()
StackExchange.using("snippets", function ()
StackExchange.snippets.init();
);
);
, "code-snippets");

StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "1"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);

StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);

else
createEditor();

);

function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader:
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
,
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);



);













draft saved

draft discarded


















StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55298212%2fcan-the-link-tags-media-attribute-prevent-css-files-from-being-downloaded%23new-answer', 'question_page');

);

Post as a guest















Required, but never shown

























0






active

oldest

votes








0






active

oldest

votes









active

oldest

votes






active

oldest

votes















draft saved

draft discarded
















































Thanks for contributing an answer to Stack Overflow!


  • Please be sure to answer the question. Provide details and share your research!

But avoid


  • Asking for help, clarification, or responding to other answers.

  • Making statements based on opinion; back them up with references or personal experience.

To learn more, see our tips on writing great answers.




draft saved


draft discarded














StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55298212%2fcan-the-link-tags-media-attribute-prevent-css-files-from-being-downloaded%23new-answer', 'question_page');

);

Post as a guest















Required, but never shown





















































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown

































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown







Popular posts from this blog

Kamusi Yaliyomo Aina za kamusi | Muundo wa kamusi | Faida za kamusi | Dhima ya picha katika kamusi | Marejeo | Tazama pia | Viungo vya nje | UrambazajiKuhusu kamusiGo-SwahiliWiki-KamusiKamusi ya Kiswahili na Kiingerezakuihariri na kuongeza habari

Swift 4 - func physicsWorld not invoked on collision? The Next CEO of Stack OverflowHow to call Objective-C code from Swift#ifdef replacement in the Swift language@selector() in Swift?#pragma mark in Swift?Swift for loop: for index, element in array?dispatch_after - GCD in Swift?Swift Beta performance: sorting arraysSplit a String into an array in Swift?The use of Swift 3 @objc inference in Swift 4 mode is deprecated?How to optimize UITableViewCell, because my UITableView lags

Access current req object everywhere in Node.js ExpressWhy are global variables considered bad practice? (node.js)Using req & res across functionsHow do I get the path to the current script with Node.js?What is Node.js' Connect, Express and “middleware”?Node.js w/ express error handling in callbackHow to access the GET parameters after “?” in Express?Modify Node.js req object parametersAccess “app” variable inside of ExpressJS/ConnectJS middleware?Node.js Express app - request objectAngular Http Module considered middleware?Session variables in ExpressJSAdd properties to the req object in expressjs with Typescript