CourseNotes_CSS Essential Training 2019
CourseNotes_CSS Essential Training 2019
Description: Cascading Style Sheets (CSS) is a stylesheet language that allows you
to control the appearance of your webpages. In this hands-on course, Christina
Truong demonstrates the concepts that form the foundation of CSS, explaining what
you need to know to tweak existing CSS and write your own. Christina explains how
to add colors and other design elements to take your webpages beyond just black
text on a white background. She shows how to use selectors, how the box model
defines the spacing and sizing of page elements, and how to style text and manage
basic layouts with Flexbox and Grid. She also covers working with advanced
selectors, creating fluid layouts, and determining when to use the float and
position properties. Plus, at the end of the course, you'll walk away with an
actual project—an online résumé page.
***********************************************
Chapter: 1. Getting Started
***********************************************
-----------------------------------------------
Video: Referencing CSS
-----------------------------------------------
Note Time: Note Text:
-----------------------------------------------
Video: Absolute paths
-----------------------------------------------
Note Time: Note Text:
***********************************************
Chapter: 2. Core Concepts
***********************************************
-----------------------------------------------
Video: Type and universal selectors
-----------------------------------------------
Note Time: Note Text:
-----------------------------------------------
Video: Class and ID selector exercise
-----------------------------------------------
Note Time: Note Text:
-----------------------------------------------
Video: Descendant selectors
-----------------------------------------------
Note Time: Note Text:
-----------------------------------------------
Video: Grouping selectors
-----------------------------------------------
Note Time: Note Text:
0:00:00
Combining Selectors
p.special {
font-weight: bold;
}
This will apply bold text to <p> elements with the class "special".
-----------------------------------------------
Video: The cascade and importance
-----------------------------------------------
Note Time: Note Text:
-----------------------------------------------
Video: Pseudo-class selectors and links
-----------------------------------------------
Note Time: Note Text:
0:03:56 :active
:active: Applied at the moment the element is activated.
a:active {
color: red; /* Changes color to red when the link is clicked */
}
0:03:56 :hover
:hover: Applied when the mouse pointer hovers over an element.
a:hover {
background-color: gray; /* Changes background to gray when hovered over */
}
0:03:56 :focus
:focus: Applied when an element gains focus.
a:focus {
outline: 2px solid orange; /* Adds an orange outline when the link is focused */
}
***********************************************
Chapter: 3. The Box Model
***********************************************
-----------------------------------------------
Video: Inline, block, and display
-----------------------------------------------
Note Time: Note Text:
-----------------------------------------------
Video: The box model properties
-----------------------------------------------
Note Time: Note Text:
0:00:28 Box Model: Think of each HTML element as a box with four parts:
Content Box: This is where your content (like text or images) goes.
Padding: This is the space around the content, inside the element.
Border: This surrounds the padding.
Margin: This is the space outside the element, separating it from other elements.
0:00:47
Width and Height: Set the size of the content area.
Padding: Adds space inside the element, around the content.
Margin: Adds space outside the element, separating it from others.
Border: Adds a border around the padding.
0:01:04 Units:
Percentage: Sizes elements relative to their container. For example, 50% width
means half the width of the container.
Pixels: Fixed size units, commonly used for web design.
-----------------------------------------------
Video: The box properties syntax and usage
-----------------------------------------------
Note Time: Note Text:
-----------------------------------------------
Video: Margin and layouts
-----------------------------------------------
Note Time: Note Text:
0:00:44 Negative Margins: These can move elements outside their default
position.
***********************************************
Chapter: 4. Typography
***********************************************
-----------------------------------------------
Video: Font-weight and font-style
-----------------------------------------------
Note Time: Note Text:
0:01:35 Typography: The art of arranging type to make text readable and
visually appealing.
-----------------------------------------------
Video: The font-size property
-----------------------------------------------
Note Time: Note Text:
0:00:11 Pixels (px): A fixed size. For example, 16px means the text is
16 pixels tall.
em: Relative to the parent element's font size. If the parent is 16px, 2em would be
32px rem:
Relative to the root element.rem: Relative to the root element.
-----------------------------------------------
Video: Font shorthand
-----------------------------------------------
Note Time: Note Text:
0:00:00 Text-Align
Common Values:
left: Aligns text to the left (default).
right: Aligns text to the right.
center: Centers the text.
justify: Spreads the text out so that each line has equal width
0:00:00 Text-Decoration
Common Values:
none: No decoration.
underline: Adds a line below the text.
overline: Adds a line above the text.
line-through: Adds a line through the text.
Color and Style:
0:03:08 Line-Height
Purpose: Controls the space between lines of text.
Common Values:
Fixed Value: 20px (absolute unit, doesn't change with font size).
Percentage: 150% (relative to the font size, adjusts automatically).
Unitless: 1.5 (also relative to the font size,).
***********************************************
Chapter: 5. Layouts: Float and Position
***********************************************
-----------------------------------------------
Video: Project: Float and box model fix
-----------------------------------------------
Note Time: Note Text:
-----------------------------------------------
Video: Position
-----------------------------------------------
Note Time: Note Text:
-----------------------------------------------
Video: Position and z-index
-----------------------------------------------
Note Time: Note Text:
0:01:42 css
.box1 {
position: relative;
z-index: 1; /* Higher stack level */
}
.box2 {
position: relative;
z-index: 2; /* Even higher stack level */
}
Static: The default value. Elements are positioned according to the normal flow of
the document.
Relative: The element is positioned relative to its normal position. You can use
top, right, bottom, and left properties to move it.
Absolute: The element is positioned relative to its nearest positioned ancestor (if
any); otherwise, it is positioned relative to the initial containing block (usually
the body).
Fixed: The element is positioned relative to the viewport, meaning it stays in the
same place even when the page is scrolled.
Sticky: The element switches between relative and fixed positioning, depending on
the scroll position. It sticks in place when you scroll past it.
***********************************************
Chapter: 6. Layouts: Flexbox and Grid
***********************************************
-----------------------------------------------
Video: Introduction to Grid and Flexbox
-----------------------------------------------
Note Time: Note Text:
0:00:47
0:00:47
Flexbox
One-Dimensional: Flexbox arranges items in a single row or column.
Alignment: It helps distribute space and align items along one axis (either
horizontally or vertically).
Grid
Two-Dimensional: Grid arranges items in both rows and columns at the same time.
Control: It gives you more control over the layout, allowing you to create complex
designs.
-----------------------------------------------
Video: Flexbox: Orientation and ordering
-----------------------------------------------
Note Time: Note Text:
-----------------------------------------------
Video: Flexbox exercise
-----------------------------------------------
Note Time: Note Text:
-----------------------------------------------
Video: Flexbox: Alignment
-----------------------------------------------
Note Time: Note Text:
0:00:34 stretch: Items stretch to fill the container along the cross
axis.
0:00:34 space-around: Equal space around each item. space-
evenly: Equal space between all items.
-----------------------------------------------
Video: The explicit grid
-----------------------------------------------
Note Time: Note Text:
The fr unit allows you to distribute space proportionally. For example, 1fr 2fr 1fr
means the second column takes up twice the space of the others.
The repeat() function simplifies grid definitions by allowing you to repeat values
easily.
grid-template-columns: repeat(3, 1fr); /* Same as 1fr 1fr 1fr */
The gap property manages spacing between grid items. For example: gap: 10px; /*
Uniform gap between items */
-----------------------------------------------
Video: The implicit grid
-----------------------------------------------
Note Time: Note Text:
0:02:37 Implicit Grid: Automatically created when there are more items
than defined tracks. CSS generates additional rows or columns to accommodate excess
items.
-----------------------------------------------
Video: Grid placement properties
-----------------------------------------------
Note Time: Note Text:
Example: grid-column: 2 / 4; means the item starts at line 2 and ends at line 4,
spanning two columns.
Example: grid-row: 1 / 3; means the item starts at line 1 and ends at line 3,
spanning two
rows. .grid-item {
grid-column: 2 / 4; /* Spanning columns 2 to 3 */
grid-row: 1 / 3; /* Spanning rows 1 to 2 */
}
***********************************************
Chapter: 7. Advanced Selectors
***********************************************
-----------------------------------------------
Video: Introduction to advanced selectors
-----------------------------------------------
Note Time: Note Text:
A flex container is set with a width of 200px and flex-wrap: wrap;. It has 3 flex
items set with flex: 1 0 100px;. What is the effective width of the third flex
item? 200px
You want your flex items to have a maximum width of 300px. Which flex rule will set
this? flex: 0 1 300px; for minimum 300px --> 1 1 300px
When will you want to use an explicit grid and an implicit grid together?
when you know the minimum number of grid items, but not the maximum
What does the following grid template define, if the grid container is set with a
700px width?
The first two columns will each be 200px wide, and the last three columns will be
100px.
-----------------------------------------------
Video: Relational selectors: Combinators
-----------------------------------------------
Note Time: Note Text:
-----------------------------------------------
Video: Project: Updates with combinators
-----------------------------------------------
Note Time: Note Text:
0:00:01 Descendant Selector: Matches any nested element.
Child Combinator: Matches only direct children.
Adjacent Sibling Combinator: Matches the first sibling immediately following an
element.
General Sibling Combinator: Matches all siblings that come after an element.
-----------------------------------------------
Video: Pseudo-class selectors: First and last
-----------------------------------------------
Note Time: Note Text:
0:01:37 :first-child and :last-child: Select the first and last elements
within a parent.
:first-of-type and :last-of-type: Select the first and last elements of a specific
type within a parent.
-----------------------------------------------
Video: Project: Advanced selectors
-----------------------------------------------
Note Time: Note Text:
Apply the Class: Add this class to the parent elements where you want the style.
html
***********************************************
Chapter: 8. Fluid and Responsive Layouts
***********************************************
-----------------------------------------------
Video: Project: Flexible background image
-----------------------------------------------
Note Time: Note Text:
-----------------------------------------------
Video: Introduction to media queries
-----------------------------------------------
Note Time: Note Text:
And: Combine multiple conditions. Example: @media (min-width: 600px) and (max-
width: 1000px) { /* CSS styles here */ }
Not: Exclude a condition. Example: @media not all and (min-width: 600px) { /* CSS
styles here */ } not: This keyword negates the condition that follows it. In this
case, it means "apply these styles if the following condition is not true."
-----------------------------------------------
Video: Media queries, widths, and breakpoints
-----------------------------------------------
Note Time: Note Text:
Desktop First: Design for larger screens first, then adjust for smaller screens
using max-width.
Mobile First: Design for smaller screens first, then adjust for larger screens
using min-width.