CSS Wrap-Up
CSCI 344: Advanced Web Technologies
Spring 2023
1
Announcements
2
Outline
3
Outline
4
Using Media Queries
Media queries allow you to set CSS style rules based on the type of media and the device dimensions of the viewport. Example:
“Turning On” Media Queries in your HTML
In order to make sure that media queries are honored, you need to include a meta tag in the <head></head> of your html file:
<meta name="viewport" content="width=device-width, initial-scale=1.0">
Approach
7
Practice: 01-media-query
8
Tablet or Mobile
Desktop
Practice: 02-media-query-with-grid
9
Practice: 02-media-query-with-grid
10
Practice: 02-media-query-with-grid
11
12
Outline
13
“Fixing” areas of your interface
If you want to fix an area of your HTML page – say, a navigation bar or side panel – you will use: position: fixed; A few notes:
14
Exercises
Open 03-fixed positioning, and update the CSS as follows:
15
Outline
16
Wave Extension
One of your tasks for HW2 is to do some basic accessibility checks. One way to do this is to install the Wave browser extension
17
Outline
18
19
20
header
main
section
Aside
21
22
body
main
header
nav
h1
aside
.news-feed
Approach to tackling HW2 Layout
High-level approach
23