How to create Responsive Web Design with Media Query Code (CSS)?

How to create Responsive Web Design with Media Query Code (CSS)?

With the expanding number of cell phones, working systems and their renditions, screen sizes and their resolutions, the requirement for versatile programs to get to sites likewise develops. The test then is to guarantee that a solitary form of the source code of UI plans on the server-side can render the site page effectively on various screen sizes. In this manner, versatile empowering web applications on tablets, cell phones, laptop and so on is not simply a question of survey a similar site page (that was initially intended for a desktop/portable workstation) on a portable program, as it will bring about even or potentially vertical parchment bars, making the page unusable. Cell phone enable web application which requires totally extraordinary way to deal with make it usable on the assortment of gadget frame components. The solution is to make the application good with each gadget that runs a web program.

A grid system is one of the key thoughts behind a responsive website architecture. This plan permits formats to fit or adjust to any screen estimate, from PCs to minor cell phones. By similarly resizing in width, every one of the components in a given format will be obvious in a gadget. Liquid systems work as an inseparable unit with CSS3 media inquiries in responsive website compositions. The media inquiries are upheld by a wide choice of programs, and they essentially empower you to gather data or information from the site client. CSS styles can then be restrictively connected utilizing the gathered information.

Media Queries in Responsive Design

Media types first appeared in HTML and CSS, which enabled the placement of separate CSS for screen and print.

<link rel=”stylesheet” type=”text/css” href=”screen.css” media=”screen”>

<link rel=”stylesheet” type=”text/css” href=”print.css”  media=”print”>

or

/* Smartphones (portrait and landscape) ———– */

@media only screen and (min-device-width : 320px) and (max-device-width : 480px) {

/* Styles */

}

 

/* Smartphones (landscape) ———– */

@media only screen and (min-width : 321px) {

/* Styles */

}

 

/* Smartphones (portrait) ———– */

@media only screen and (max-width : 320px) {

/* Styles */

}

 

/* iPads (portrait and landscape) ———– */

@media only screen and (min-device-width : 768px) and (max-device-width : 1024px) {

/* Styles */

}

 

/* iPads (landscape) ———– */

@media only screen and (min-device-width : 768px) and (max-device-width : 1024px) and (orientation : landscape) {

/* Styles */

}

 

/* iPads (portrait) ———– */

@media only screen and (min-device-width : 768px) and (max-device-width : 1024px) and (orientation : portrait) {

/* Styles */

}

/**********

iPad 3

**********/

@media only screen and (min-device-width : 768px) and (max-device-width : 1024px) and (orientation : landscape) and (-webkit-min-device-pixel-ratio : 2) {

/* Styles */

}

 

@media only screen and (min-device-width : 768px) and (max-device-width : 1024px) and (orientation : portrait) and (-webkit-min-device-pixel-ratio : 2) {

/* Styles */

}

/* Desktops and laptops ———– */

@media only screen  and (min-width : 1224px) {

/* Styles */

}

 

/* Large screens ———– */

@media only screen  and (min-width : 1824px) {

/* Styles */

}

Contact Nevpro Business Solutions today!

Join us here!