CSS Font
Hôm nay ta sẽ tìm hiểu một số thuộc tính cơ bản như font , text, color, background. Ta xem ví dụ sau:
<style>
p {
font-family: 'Tahoma';
font-weight: bold;
font-size: 30px;
color: red;
background-color: lightyellow;
text-align: center;
text-decoration: underline;
}
</style>
<p>Hello World</p>
Hello World
Ta có font-family để xét font chữ, font-weight để xét đậm nhạt, font-size để xét kích cỡ chữ. color để xét màu chữ, background-color xét màu nền của thẻ, text-align có left, right, center, justify. Thuộc tính text-decoration có underline( gạch chân ) , overline (gạch trên đầu), line-through(gạch nganh chữ) , hoặc none (không có gạch).
* text-align: right và text-decoration: overline
<style>
p {
font-family: 'Tahoma';
font-weight: bold;
font-size: 30px;
color: red;
background-color: lightyellow;
text-align: right;
text-decoration: overline;
}
</style>
<p>Hello World</p>
Hello World
* text-align: left và text-decoration: line-through
<style>
p {
font-family: 'Tahoma';
font-weight: bold;
font-size: 30px;
color: red;
background-color: lightyellow;
text-align: left;
text-decoration: line-through;
}
</style>
<p>Hello World</p>
Hello World
* text-align: justify và text-decoration: none
<style>
p {
font-family: 'Tahoma';
font-weight: bold;
font-size: 30px;
color: red;
background-color: lightyellow;
text-align: justify;
text-decoration: none;
}
</style>
<p>Hello World</p>
Hello World
Mỗi ngày chúng ta học một ít nhé. Chúc vui ^_^