Using media queries to change text color - HTML CSS CSS Layout

HTML CSS examples for CSS Layout:Responsive Media

Description

Using media queries to change text color

Demo Code

ResultView the demo in separate window

<html>
 <head> 
  <style>
.colored {<!-- www  .j a va 2s  . c o m-->
   color:Chartreuse;
}

#body {
   font-size:27px;
}

@media only screen and (max-width:480px)  {
   .colored {
      color:yellow;
   }

}
</style> 
 </head> 
 <body> 
  <div id="body"> 
   <p>Lorem ips</p> 
   <p class="colored">Lorem ipsum dolor sit amet, consectetur adipiscing elit. Morbi ullamcorpe</p> 
   <p>Lore</p> 
  </div>  
 </body>
</html>

Related Tutorials