CSS @media rule



The @media rule specifies the target media types (separated by commas) of a set of rules.

Example

Let us see an example of @media rule −

<style>
   <!--
      @media print {
         body { font-size: 10pt }
      }

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

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

   -->
</style>
Samual Sam
Samual Sam

Learning faster. Every day.


Advertisements