Class 8: What I Learned This Week…
CSS Layout:
Content first and start with the most important that you want your viewers to see at the top before scrolling to less important content. For example with newspapers, they know that it will get folded in half horizontally so the most important piece of news needs to be at the top to grab the viewers attention. Similarly with web pages, you want to make the top part of your page that is visible, interesting enough for viewers to want to keep scrolling.
User’s eyes always start top left because we read from left to right, so important content, such as a form on a holiday booking website, should be located there.
We have now moved away from websites that actually look like a desktop version, they are starting to look more like they do on mobile, such as the search bar centred at the top.
Five Types of Page Layouts:
- Fixed-width layouts – Absolute pixel dimensions for width
- Fluid layouts – Elements given percentage dimensions
- Elastic layouts – Elements using ems to accommodate changing text size
- Hybrid layouts – Using combinations of above
- Responsive layouts – Combination of fluid and media queries
Grid Layout
Area:
Grid-area: 1/1/2/3;
Columns/Rows:
Grid-column: 1;
Grid-row: 2;
Named Areas:
Main { grid-area: main; }
Fluid Layouts
- Percentages instead of pixels
- Fractional layouts usually used for grid layouts: Display: grid; Grid-template-columns: 2fr 1fr;