Professional Documents
Culture Documents
2
▪
▪
▪
▪
3
4
Selector { property:value;…. }
6
▪
▪
▪
7
▪
▪
Ví dụ:
<H1 STYLE="color: yellow">This is yellow </H1>
8
<head>
<style type=“text/css” >
<!–
SelectorName{
property 1:value1;
property 2:value2;
………
property N: valueN;
}
…-->
</style>
</head> 9
<!DOCTYPE html>
<html>
<head>
<style>
body {
background-color: #000;
}
h1 {
color: red;
margin-left: 40px;
}
</style>
</head>
<body>
<h1>This is a heading</h1>
<p>This is a paragraph.</p>
</body>
</html>
10
11
▪
<head>
<link rel=“stylesheet” href=“URL” type="text/css">
</head>
12
13
▪
body {
background-color: lightblue;
}
h1 {
color: navy;
margin-left: 20px;
}
14
▪
<!DOCTYPE html>
<html>
<head>
<link rel="stylesheet" type="text/css" href="mystyle.css">
</head>
<body>
<h1>This is a heading</h1>
<p>This is a paragraph.</p>
</body>
</html>
15
16
➢
▪
▪
▪
▪
17
▪
▪
.TieuDe1 {
color: red;
font-family: Verdana, sans-serif;
}
18
https://www.w3schools.com/css/css_selectors.asp
19
<!DOCTYPE html>
<html>
<head>
<style>
p {
text-align: center;
color: red;
}
</style>
</head>
<body>
<p>Tất cả các đoạn văn bản sẽ bị ảnh hưởng</p>
<p id="para1">Me too!</p>
<p>And me!</p>
</body>
</html>
20
21
22
23
selector { position: giá trị; }
24
25
26
27
28
29
30
31
32