Danh ngôn cuộc sống:
• Bài viết được đăng bởi: Mr. Phan Nhan• Ngày cập nhật bài viết: 12/05/2016• Tổng lược xem trang: 122 / 1 khách• Đánh giá bởi người dùng: |
Định nghĩa và sử dụng. Thuộc tính font thiết lập font cho thành phần, bao gồm font chữ, độ rộng, loại, ... Cấu trúc:
tag {
font: giá trị;
}
- Xác định giá trị font family cho chữ.font: giá trị;
}
<html>
<head>
<style type="text/css">
p.fontArial {
font-family: Arial, Helvetica, sans-serif;
}
p.fontCourier {
font-family: "Courier New", Courier, monospace;
}
</style>
</head>
<body>
<p class="fontArial">font Arial</p>
<p class="fontCourier">font Courier</p>
</body>
</html>
- Xác định kích cỡ cho chữ.<head>
<style type="text/css">
p.fontArial {
font-family: Arial, Helvetica, sans-serif;
}
p.fontCourier {
font-family: "Courier New", Courier, monospace;
}
</style>
</head>
<body>
<p class="fontArial">font Arial</p>
<p class="fontCourier">font Courier</p>
</body>
</html>
<html>
<head>
<style type="text/css">
p.size200 {
font-size: 200%;
}
</style>
</head>
<body>
<p>font-size</p>
<p class="size200">font size 200%</p>
</body>
</html>
- Xác định loại cho chữ.<head>
<style type="text/css">
p.size200 {
font-size: 200%;
}
</style>
</head>
<body>
<p>font-size</p>
<p class="size200">font size 200%</p>
</body>
</html>
<html>
<head>
<style type="text/css">
p.fontNormal {
font-style: normal;
}
p.fontItalic {
font-style: italic;
}
p.fontOblique {
font-style: oblique;
}
</style>
</head>
<body>
<p class="fontItalic">font style normal</p>
<p class="fontItalic">font style italic</p>
<p class="fontOblique">font style oblique</p>
</body>
</html>
- Chuyển đổi kiểu chữ (thường thành hoa).<head>
<style type="text/css">
p.fontNormal {
font-style: normal;
}
p.fontItalic {
font-style: italic;
}
p.fontOblique {
font-style: oblique;
}
</style>
</head>
<body>
<p class="fontItalic">font style normal</p>
<p class="fontItalic">font style italic</p>
<p class="fontOblique">font style oblique</p>
</body>
</html>
<html>
<head>
<style type="text/css">
p.fontVariant {
font-variant: small-caps;
}
</style>
</head>
<body>
<p>font variant normal</p>
<p class="fontVariant">Font Variant Small Caps</p>
</body>
</html>
- Chuyển đổi kiểu chữ (thường thành chữ in đậm).<head>
<style type="text/css">
p.fontVariant {
font-variant: small-caps;
}
</style>
</head>
<body>
<p>font variant normal</p>
<p class="fontVariant">Font Variant Small Caps</p>
</body>
</html>
<html>
<head>
<style type="text/css">
p.fontWeightNormal {
font-weight: normal;
}
p.fontWeight600 {
font-weight: 600;
}
p.fontWeightBold {
font-weight: bold;
}
</style>
</head>
<body>
<p class="fontWeightNormal">font weight normal</p>
<p class="fontWeight600">font weight 600</p>
<p class="fontWeightBold">font weight bold</p>
</body>
</html>
HTML viết:<head>
<style type="text/css">
p.fontWeightNormal {
font-weight: normal;
}
p.fontWeight600 {
font-weight: 600;
}
p.fontWeightBold {
font-weight: bold;
}
</style>
</head>
<body>
<p class="fontWeightNormal">font weight normal</p>
<p class="fontWeight600">font weight 600</p>
<p class="fontWeightBold">font weight bold</p>
</body>
</html>
<html>
<head></head>
<body>
<p>đây là nơi chứa nội dung cần hiển thị.</p>
</body>
</html>
CSS viết:<head></head>
<body>
<p>đây là nơi chứa nội dung cần hiển thị.</p>
</body>
</html>
p {
font-size: 150%;
}
font-size: 150%;
}
Những bài viết được đăng mới nhất. 



