-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path0.02_cssIds.html
41 lines (41 loc) · 1.19 KB
/
0.02_cssIds.html
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
<!DOCTYPE html>
<html>
<head>
<title>CSS Ids</title>
<link rel="stylesheet" type="text/css" href="./0.02_cssIds.css">
</head>
<body>
<h1>Ids</h1>
<p>An ID is a unique identifier</p>
<div>
<h3>Id notes</h3>
<ul class="customClass">
<li id="customId">Is unique to the element that it's on</li>
<li>to target it from our css we need to use a # sign</li>
<li> you can use them with classes on the same element</li>
</ul>
</div>
<br>
<br>
<h1>CSS ids</h1>
<p>An ID is a UNIQUE identifier</p>
<h4>id notes</h4>
<ul>
<li>start with a pound - #.</li>
<li>uses: header or an about section.</li>
<li>should only be used once per page - the are unique! Important with jQuery later on.</li>
<li>Use for one off styling.</li>
</ul>
<br>
<h1>Ids vs Classes</h1>
<h2>Ids</h2>
<p id="number-one">This id will be linked in the CSS page by a #</p>
<p id="number-one number-two">You can't have two ids on an element.</p>
<br>
<h2>classes</h2>
<p class="first-class">one class here.</p>
<p class="first-class second-class">two classes here.</p>
<br>
<p id="number-one">You can use an id twice, but it's best not to. It should be used mostly for targeting specific items.</p>
</body>
</html>