Files
advanced-css/Natours/starter
2024-03-15 14:34:14 +01:00
..
2024-03-15 14:34:14 +01:00
2023-07-11 00:11:30 +02:00
2024-01-14 16:42:47 +01:00
2024-03-15 14:34:14 +01:00
2023-09-11 23:10:40 +02:00
2024-03-15 14:34:14 +01:00
2024-01-14 16:42:47 +01:00
2024-01-14 16:42:47 +01:00
2023-09-09 16:47:47 +02:00

Run

$ live-server $ npm run compile:sass

Bases of responsive design

  • Use fluid layouts
  • Use % instead of px, especially in images
  • Use max-width instead of width, especially in images
  • Use rem instead of px
  • Use media queries when the rest fails

Fluid Layouts

  • Float : older way of doing the same job
  • Flexbox : 1 dimensional rows
  • CSS Grid : 2 dimensional grids

Selectors

  • Select all the elements that starts with col-
[class^='col-'] {
    background-color: red;
}
  • Select all the elements that ends with col-
[class$='col-'] {
    background-color: red;
}