Home » Tip Bank » Web Development » CSS
  • Email Article
  • Comment on this Article
  • Share Article
    • Digg
    • del.icio.us
    • Newvine
    • furl
    • StumbleUpon
    • BlinkList
    • Newsvine
    • Magnolia
    • Facebook
    • Tailrank
    • Slashdot
    • Technorati
    • Google Bookmarks
    • Yahoo Favorites
    • Windows Live
    • Ask
Language: Semantic Web
Expertise: Intermediate
Nov 17, 2017

Conditionally Load CSS Files Based on the Media

The link tag in HTML supports the media element that allows you to specify the media type, and additional conditions such as the width and load a specified CSS file. For example, the following link tag loads a CSS file called "longWidth.css" only if the media is of type "Screen" and its width matches the minimum and maximum values specified.

css" /
Srinath M S
 
Submit a Tip
Browse "Web Development" Tips
Browse All Tips
javascriptkit.com
w3schools.com