Contents
Chapter 1: Introducing CSS—the Language of Web Design
Why Designers Took So Long to Embrace CSS
Understanding the Different Versions of CSS
Why Are They Called “Cascading” Style Sheets?
Test Your CSS Early in Several Browsers
Use Browser Developer Tools to Inspect Your CSS
Chapter 2: Using Basic Selectors
Deciding Which Selector to Use
Changing the Look of the Cursor
What Happens When Style Rules Conflict?
Chapter 3: Specifying Sizes, Colors, and Files
Specifying Size and Other Units of Measurement
Creating Transparent Colors with the RGBA and HSLA Formats
Specifying Background Images and Other Files
Using font-family to Choose a Range of Alternative Fonts
Using font-style to Italicize Text
Using font-weight to Make Text Bolder or Lighter
Using font-variant to Display Text in Small Caps
Adjusting the Vertical Space Between Lines of Text
Using the Shorthand font Property
Increasing or Decreasing the Space Between Letters
Controlling the Space Between Words
Drawing Lines Under, Above, and Through Text
Indenting the First Line of Text
Switching Between Uppercase and Lowercase
Controlling Whitespace and Line Wrapping
Dealing with Text That’s Too Long
Chapter 5: Embedding Web Fonts
Adding Web Fonts to Your Sites
Storing Fonts on Your Own Server
Choosing the Right Font Formats
Embedding Fonts with @font-face
“Bulletproof” @font-face Syntax
Specifying a Range of Characters
Chapter 6: Understanding the CSS Box Model
Introducing the Components of the Box Model
Using Padding and Margins to Add Space Around Elements
Isn’t There an Easier Box Model?
Using Margins to Improve Page Layout
Removing the Default Margin from Your Pages
Centering Block-level Elements
Changing Layout with the display Property
Understanding the Difference between inline and inline-block
Using the display Property to Hide Elements
Handling Content That’s Too Big
Chapter 7: Floating Elements for Layout
Using float to Flow Text Around Images
Preventing Elements from Moving Alongside a Floated Element
Adding a Sidebar Using the float and margin Properties
Controlling Backgrounds with CSS
Changing the Background Color of an Element
Controlling How Background Images Repeat
Controlling Background Images During Scrolling
Controlling the Position of Background Images
Setting the Size of Background Images
Using the background Shorthand Property
Adding Multiple Background Images to an Element
Chapter 9: Adding Borders and Drop Shadows
Setting Individual Border Properties
Using Border Shorthand Properties
Preventing Borders and Backgrounds from Extending Under Floats
Adding Rounded Corners and Drop Shadows Without Images
Creating Rounded Corners With border-radius
Adding Drop Shadows With box-shadow
Individual Properties for Border Images
Using the Shorthand Property for Border Images
Avoiding Problems With the Center Slice
Chapter 10: Styling Lists and Navigation Menus
Styling Unordered and Ordered Lists
Changing the Position of the Symbol
Replacing the Symbol with Your Own Image
Using the list-style Shorthand Property
Creating a Navigation Bar from a List
Creating a Vertical Text-based Navigation Bar
Creating a Horizontal Text-based Navigation Bar
Using CSS Sprites in a Navigation Bar
Chapter 11: Positioning Elements Precisely
How Does CSS Positioning Work?
Understanding the Different Types of Positioning
Identifying the Containing Block
Setting the Offsets of a Positioned Element
Fixing Elements Inside the Browser Window
Setting the Stacking Order with z-index
Understanding the Stacking Context
Using CSS Positioning for Tooltips and Menus
Masking an Absolutely Positioned Element
Chapter 12: Cross-Browser Layout Techniques
What Size Browser Window Should I Design For?
Creating a Single-column Layout
Using Floats for a Two-column Layout
Putting the Sidebar First and Floating It to One Side
Putting the Main Content First
Using Floats for a Three-column Layout
Using CSS Table Display for Layout
Using CSS Table Display for Forms
Improving Accessibility with a “Skip to Main Content” Link
Part IV: Advanced CSS Techniques
Chapter 13: Using Advanced Selectors
Selecting First, Last, and Only Instances
Selecting Elements Based on their Position in a Series
Using a Number to Specify the Position
Specifying a Recurring Sequence
Selecting Elements Based on Their Relationship with Another
Using the Adjacent Sibling Combinator
Using the General Sibling Combinator
Selecting Form Elements Based on Their State
Selecting Elements Based on Negative Factors
Pseudo-elements for Generated Content
Defining Table Header and Footer Rows
Grouping Table Rows into Sections
Eliminating the Space Between Cells
Adding Borders to Columns and Rows
Applying Other Styles to Columns
Using the visibility Property with Table Rows
Adjusting the Space Between Table Cells
Adjusting Horizontal and Vertical Space Inside Table Cells
Controlling the Position of the Table Caption
Controlling the Width of a Table
Controlling the Horizontal and Vertical Alignment of Table Cells
Defining the Content to be Inserted
Generating Content from an Attribute
Generating Quotes Automatically
Creating Fun Visual Effects with Generated Content
Chapter 16: Creating a Print Style Sheet
What’s Different About Print CSS?
Issues that Need to be Considered
What Print Style Sheets Cannot Do
Specifying Media Types with @import
Specifying Media Types for Embedded Styles
Controlling Where to Break Content
Controlling How Elements Are Broken
Using the Cascade for Print Styles
Attaching Independent Style Sheets
Chapter 17: Targeting Styles with Media Queries
Creating Responsive Web Designs
Browser Support for Media Queries
Attaching External Style Sheets
Using Media Queries Inside Style Sheets
Normalizing Width Values for Mobile Devices
Setting the Viewport Size in HTML
Setting the Viewport Size in CSS
Width and Orientation—A Conundrum
Controlling Background Images with Media Queries
Controlling Images Embedded in the HTML
Providing Images for High-Resolution Displays
Chapter 18: Using CSS3 Multi-Column Layout
Browser Support for Multi-Column Layout
Setting the Width and Number of Columns
Setting Only the Number of Columns
Setting the Gap and Rule Between Columns
Adding a Vertical Rule Between Columns
Spanning, Filling, and Breaking Columns
Controlling How Columns Are Filled
Chapter 19: Creating Gradients Without Images
Using Browser-Specific Prefixes
Using Keywords to Set the Direction of the Gradient Line
Setting the Angle of the Gradient Line
Syntax for Browser-Specific radial-gradient() Functions
Creating a Smooth Repeating Gradient
Creating Repeating Radial Gradients
Chapter 20: 2D Transforms and Transitions
Browser Support for 2D Transforms and Transitions
Animating Property Values with CSS Transitions
Choosing Which Properties to Animate
Specifying the Duration of the Transition
Setting the Pace of the Transition
Changing the Reverse Transition
Using CSS Transitions with Images
Creating a Rollover Image Without JavaScript
Chapter 21: Animating with CSS Keyframes
Browser Support for CSS Animations
Specifying the Pace of Change Between Keyframes
Animating Elements with Keyframes
Specifying Which Animation to Use
Setting the Duration of an Animation
Setting the Timing Function Between Keyframes
Setting the Number of Times an Animation Runs
Specifying Whether the Animation Should Run in Reverse
Controlling Properties Before and After Animation
Using the animation Shorthand Property
Understanding Flex Layout Terminology
Controlling the Flow in a Flex Container
Reordering Individual Flex Items
Controlling the Dimensions of Flex Items
Other Features to Look Forward To
3.136.233.19