Table of Contents
Introduction vii
Getting Started with HTML 1
Creating an HTML File 2
Doctype HTML 2
HTML Tag 3
Opening and Closing Tags 5
Head Tag 6
Meta Tag 7
Title Tag 8
Body Tag 9
Elements 10
Main 14
Headings 15
Paragraphs 17
Figures and Images 19
Figure Captions 22
Links 24
Attributes 27
Classes 27
IDs 30
Nesting 32
Lists 33
Ordered Lists 33
Unordered Lists 35
Basic Web Page Review 37
Getting Started with CSS 39
Creating a CSS File 40
Linking the HTML File to a CSS File 41
Identifying Elements and Attributes 43
Selecting and Styling an Element in CSS 44
Using Element Selectors 45
Web Pages Are Made Up of Pixels 46
Defining Height and Width 47
Choosing Colors 51
Styling Background Colors 52
Styling Font Color 56
Styling Borders 57
Styling Font Size 63
Styling the Font Family 64
Serif 64
Sans Serif 65
Font Style 65
Normal 65
Oblique 66
Text Align 67
Left Align 67
Center 68
Right Align 66
The Box Model 72
Margins 73
Modifying the Margin for Each Individual Side 76
Padding 78
Adding Padding to Each Individual Side 81
Nested Element Positioning 82
Styling a Class 87
Styling an ID 89
Flexbox 93
Justify Content: Center 98
Justify Content: Left, Right, or Evenly Spaced 101
Try It On Your Own 105
Writing an HTML File for a Colors Website 105
Writing a CSS File for the Colors Website 106
Writing an HTML File for an Animal Website 108
Writing a CSS File for the Animal Website 110
Writing the CSS Code, Exercise 1 112
Writing the CSS Code, Exercise 2 114
Writing Both the HTML and CSS Code 116
Drawing It Out: Sports Web Page 118
Designing and Building Your Own Websites 119
Website 1 119
Website 2 121
Website 3 123
Website 4 125
Answers to Quick Checks 127
HTML Quick Check 127
CSS Quick Checks 127