How to specify media dependencies for CSS style sheets

CSSWeb DevelopmentFront End Technology

The following are the two ways to specify media dependencies for style sheets

  • Specify the target medium from a style sheet with the @media or @import at-rules.
  • Specify the target medium within the document language.


Let us see an example of @media rule −

      @media print {
         body { font-size: 10pt }

      @media screen {
         body { font-size: 12pt }

      @media screen, print {
         body { line-height: 1.2 }

Updated on 16-Mar-2020 07:10:25