Redi School Munich - Spring 2021
There weren't many devices, websites were designed for computers only
Something had to change!
People started to create another website for mobile screens
But it wasn't!
After lots of trial and errors and many other "great" ideas
came to life!
Is an approach to web design that lets our website adapt to different screen and window sizes
Mobile traffic makes up for more than 51% of all traffic
max-width
and srcset
img {
max-width: 100%;
}
More on Responsive images
They allow us to target the certain conditions and apply CSS when those rules match
viewport is larger than 320px
the device is a touchscreen
@media media-type and (media-feature-rule) {
/* CSS rules go here */
}
/* When the browser is at least 600px and above */
@media screen and (min-width: 600px) {
.element {
/* Apply some styles */
}
}
@media
Is a css rule that let us target different conditions
Media type is what we are targeting, the most common being screen
Other values include all
and print
Media features test a single specific feature of the target device, most common are min-width
and max-width
Other values include orientation
or hover
The operator let us combine different media features to make a more specific rule
We can use and
, not
and or
Until now we have only focused on doing things for desktop
Mobile first design is a design strategy that says when you create a website or app, you should start sketching and prototyping the smallest screen first and work your way up to larger screens. Essentially, it’s about delivering the right user experience to the right device.
The browser's viewport is the area of the window in which web content can be seen
device-width is the width of the screen in CSS pixels at a scale of 100%.
The initial-scale property controls the zoom level when the page is first loaded
Take the previous homework and make all necessary changes so it is responsive in every size