-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathid_class.html
50 lines (34 loc) · 1011 Bytes
/
id_class.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
42
43
44
45
46
47
48
49
50
<!DOCTYPE html>
<html>
<head>
<title>CSS Id & Class</title>
<style type="text/css">
#para1
{
text-align:center;
color:red;
}
.center
{
text-align:center;
}
p.center2
{
text-align:center;
}
</style>
</head>
<body>
<h1>CSS Id & Class</h1>
<h4>You can set styles for individual groups you create or individual elements using class and id</h4>
<p id="para1">Hello World!</p>
<p>This paragraph is not affected by the style.</p>
<h2>Do NOT start an Id name with a number! It will not work in Mozilla/Firefox</h2>
<h4>The class Selector</h4>
<h1 class="center">Center-aligned heading</h1>
<p class="center">Center-aligned paragraph.</p>
<h4>You may also reference specific element types within a class</h4>
<h1 class="center2">This heading will not be affected</h1>
<p class="center2">This paragraph will be center-aligned.</p>
</body>
</html>