Retrofit existing web page with mobile CSS


To retrofit, use the CSS media queries, and allow different stylesheets to different browser capabilities. A benefit is that you do not have to go for any server-side code.

This would require you to add specific detection code to the script for grouping of the device.

The media queries handle even devices you've never heard of.

Set the following:

@media handheld and (max-width: 480px), screen and (max-device-width: 480px), screen and (max-width: 600px) {
   body {
      color: blue;
   }
}

karthikeya Boyini
karthikeya Boyini

I love programming (: That's all I know

Updated on: 29-Jan-2020

89 Views

Kickstart Your Career

Get certified by completing the course

Get Started
Advertisements