Script Media Type & Preload

February 14, 2023

Screen Size Specific Load

<link media=”only screen and (max-device-width: 480px)” href=”iPhone.css” type=”text/css” rel=”stylesheet” />

<link media="only screen and (max-device-width: 480px)"
href="iPhone.css" type="text/css" rel="stylesheet" />

On Load Event

Shown below the onload attribute in the link allows the CSS to be processed when it finishes loading.

<link rel="preload" href="styles.css" as="style" onload="this.onload=null;this.rel='stylesheet'">
<noscript><link rel="stylesheet" href="styles.css"></noscript>

References


TAGS: nerd talk

The Shop



Handmade knit hats made from 100% baby alpaca yarn.

Interested in placing a custom order?

INQUIRE NOW

Information is not knowledge. The true sign of intelligence is not knowledge but imagination. Imagination is more important than knowledge. Logic will take you from point ‘A’ to ‘B’. Imagination will take you everywhere.