<link rel="stylesheet" href="/path/to/my.css" media="print" onload="this.media='all'">
In the link’s media attribute is set to print
. Print is a media type which will apply to the print based media or when user tries to print the page. By applyinhg this the CSS will load Asynchronosuly. But we need to apply the style to the page also, for that we can use the onload
attribute to set the link’s media to all when it finishes loading.
What are your thoughts on this post?
I’d love to hear from you! Click this link to email me—I reply to every message!
Also use the share button below if you liked this post. It makes me smile, when I see it.