The popularity of smart phones created a massive need for websites to be accessible on small screens. It is now almost expected for all sites to be responsive.
Introduced in 1999. Very very simplistic websites. Almost completely gone by 2013.
Completely separate version of the website. They are slimmed down versions of the desktop version with fewer features.
Very similar to responsive, but had hard defined breakpoints. Sites would perform significant UI changes at certain resolutions.
The website shifts content size and arrangement based on screen size. Elements grow and shrink fluidly with the layout.
A webpage's viewport declares what size your content on a device.
Mobile devices would scale down desktop web pages to fit their screen.
This tells the device the window is the width of the device and we do not want to scale.
W3 SchoolsMedia queries allow us to apply different CSS rules based on environment variables.
They can be thought of as if
statements in CSS.
@media screen{
body {
color: red;
}
}
@media print{
body {
color: black;
}
}
@media screen and (min-width:320px) and (max-width:600px){
/*rules apply to screen widths 320px to 600px;*/
p{
color:red;
}
div{
float:right;
}
}
@media screen and (max-width:320px){
/*rules apply to screen widths below 320px*/
}