-
Notifications
You must be signed in to change notification settings - Fork 2
Week 11: CSS Layout
Reid Russom edited this page Apr 13, 2024
·
4 revisions
Week | Topic | Learning Objectives | Key Resources |
---|---|---|---|
11 | CSS Layout | Students will be able to create a flexbox layout on one or more sections of their portfolio project by using correct syntax and proper class/id assignment in their css and html files. | Week 11 Slides (TBD) |
- Shorthand property for 8 background-related properties
- Set colors, images, position, size, and repetition
- Multiple background layers possible
- Refer to MDN docs for syntax and usage
- Shorthand property for setting border size, style, and color
-
border-radius
creates rounded corners - Refer to MDN docs for
border
andborder-radius
- Adds shadow effect around an element
- Creates depth and separation between elements
- Best used sparingly with lighter colors
- Refer to MDN docs for
box-shadow
- Defines what happens when content is too big to fit
- Commonly used to add scrollbars to scrollable content
- Refer to MDN docs for
overflow
- Sets the opacity level of an element
- Refer to MDN docs for
opacity
and examples
-
static
is default,top
,right
,bottom
,left
do not affect position -
relative
allows displacement usingtop
,right
,bottom
,left
- Positions element at exact point, removes from normal flow
- Positioned relative to ancestor element
- Use sparingly, prioritize flexbox or grid for layouts
- Removes from normal flow, positions relative to viewport
- Elements stay in place while scrolling
- Useful for navbars and floating buttons
- Acts normal until scrolled past, then behaves like fixed
- Not taken out of normal flow
- Useful for section headings, category labels while scrolling
- Can be complicated, use dev tools for debugging
- Play with code examples to understand
- Reference lessons and resources for assignments
- Arranges items into rows or columns
- Items flex based on defined rules
- Interactive examples provided for experimentation
- Resizing frame shows how items fill available area
- Flex container: element with
display: flex
- Flex item: element directly inside flex container
- Elements can be both containers and items
- Nesting builds complex layouts
- Powerful tool for arranging, sizing, placing elements
- Experiment with code examples
- Use "Edit on CodePen" or "Fork on CodePen" for full-sized environment
- Some examples may benefit from larger view
Potential trouble spots for students:
- Forgetting to set
display: flex
on the parent container when using flexbox, causing layout issues - Confusing
justify-content
andalign-items
properties in flexbox layouts - Misunderstanding how absolute and fixed positioning remove elements from the normal document flow
- Struggling to grasp the concept of sticky positioning and when to use it effectively
- Overusing
position: absolute
for layout instead of leveraging flexbox or grid systems
- Merged previous lesson-9 pull request into main branch
- Created new lesson-10 branch from updated main branch
- Created a css folder at the same level as README.md and index.html
- Created an index.css file inside the css folder
- Linked the index.css file in the index.html file using a element
- Changed the background color of the page body
- Changed the default text color
- Customized the font family
- Added spacing (padding/margin) between sections
- Changed the alignment of the content of at least one section
- Changed the font size, weight, and color of headings
- Transformed the style of the student's name at the top of the page
- Transformed the "Experience" list items into styled blocks
- Transformed the style of the "Connect" links
- Loaded a font family from Google Fonts
- Added a picture of the student to HTML and/or CSS with accessibility aspects
- Used social media icons to replace link text with images
- Staged changes using
git add
- Committed changes with a meaningful commit message using
git commit
- Pushed changes to the GitHub repository using
git push
- Created a pull request for the lesson-10 branch
- Changed at least one background color
- Changed at least one font
- Changed at least one text color
- Changed the padding and margin of at least one element
- Changed the alignment of at least one element
- Changed the look of heading elements
- Changed the look of the student's name
- Changed the look of list items
- Changed the look of links
The Intro Guidebook is created by Code the Dream staff and volunteers for Code the Dream volunteers. This is your tool – please feel free to suggest edits or improvements.
Overview of the wiki.
Onboarding guide for new volunteers.
Links to pages for specific assignments, including rubrics, overviews of student content, and mentor-created resources.