-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcss.html
More file actions
99 lines (81 loc) · 2.25 KB
/
css.html
File metadata and controls
99 lines (81 loc) · 2.25 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>CSS Basics</title>
<link rel="stylesheet" href="css/style.css">
</head>
<body>
<header>
<h1>CSS Basics</h1>
<p>Learn how to style your website using Cascading Style Sheets.</p>
</header>
<nav>
<a href="index.html">Home</a>
<a href="text.html">First HTML file</a>
<a href="links.html">Links</a>
<a href="images.html">Images</a>
<a href="lists.html">Lists</a>
<a href="tables.html">Tables</a>
<a href="css.html">CSS</a>
</nav>
<div class="content">
<div class="lesson-box">
<h2>What Is CSS?</h2>
<p>CSS (Cascading Style Sheets) controls how your website looks.
HTML builds the structure, CSS adds the design.</p>
</div>
<div class="lesson-box">
<h2>Linking a CSS File</h2>
<p>You already linked your stylesheet in your HTML pages:</p>
<pre>
<link rel="stylesheet" href="css/style.css">
</pre>
<p>This tells the browser to load your CSS rules.</p>
</div>
<div class="lesson-box">
<h2>Changing Text Color</h2>
<p>In your <code>style.css</code> file, add:</p>
<pre>
h1 {
color: blue;
}
</pre>
<p>This will make all <code><h1></code> headings blue.</p>
</div>
<div class="lesson-box">
<h2>Changing Background Color</h2>
<p>You can change the background of the whole page:</p>
<pre>
body {
background-color: #f0f0f0;
}
</pre>
</div>
<div class="lesson-box">
<h2>Styling Boxes</h2>
<p>Your lessons use a <code>.lesson-box</code> class.
You can style it like this:</p>
<pre>
.lesson-box {
background: white;
padding: 20px;
border-radius: 8px;
margin-bottom: 20px;
}
</pre>
</div>
<div class="lesson-box">
<h2>Lesson Checkpoint</h2>
<p>Before moving on, make sure you have:</p>
<ol>
<li>Opened your <code>css/style.css</code> file.</li>
<li>Added styles for <code>body</code>, <code>h1</code>, and <code>.lesson-box</code>.</li>
<li>Committed your changes to GitHub.</li>
<li>Viewed your updated site on GitHub Pages.</li>
</ol>
<p>Use the navigation bar to continue learning.</p>
</div>
</div>
</body>
</html>