Đây là đoạn văn bản bằng Paragraphs - thẻ p
Contrary to popular belief, Lorem Ipsum is not simply random text. It has roots in a piece of classical Latin literature from 45 BC, making it over 2000 years old.
Richard McClintock, a Latin professor at Hampden-Sydney College in Virginia, looked up one of the more obscure Latin words, consectetur,
from a Lorem Ipsum passage, and going through the cites of the word in classical literature, discovered the undoubtable source. Lorem Ipsum comes from sections 1.10.32 and 1.10.33 of "de Finibus Bonorum et Malorum"
(The Extremes of Good and Evil) by Cicero, written in 45 BC. This book is a treatise on the theory of ethics, very popular during the Renaissance. The first line of Lorem Ipsum,
"Lorem ipsum dolor sit amet..", comes from a line in section 1.10.32.
The standard chunk of Lorem Ipsum used since the 1500s is reproduced below for those interested.
Sections 1.10.32 and 1.10.33 from "de Finibus Bonorum et Malorum" by Cicero are also reproduced in their exact original form, accompanied by English versions from the 1914 translation by H. Rackham.
Contrary to popular belief, Lorem Ipsum is not simply random text. It has roots in a piece of classical Latin literature from 45 BC, making it over 2000 years old.
Richard McClintock, a Latin professor at Hampden-Sydney College in Virginia, looked up one of the more obscure Latin words, consectetur,
from a Lorem Ipsum passage, and going through the cites of the word in classical literature, discovered the undoubtable source. Lorem Ipsum comes from sections 1.10.32 and 1.10.33 of "de Finibus Bonorum et Malorum"
(The Extremes of Good and Evil) by Cicero, written in 45 BC. This book is a treatise on the theory of ethics, very popular during the Renaissance. The first line of Lorem Ipsum,
"Lorem ipsum dolor sit amet..", comes from a line in section 1.10.32.
The standard chunk of Lorem Ipsum used since the 1500s is reproduced below for those interested.
Sections 1.10.32 and 1.10.33 from "de Finibus Bonorum et Malorum" by Cicero are also reproduced in their exact original form, accompanied by English versions from the 1914 translation by H. Rackham.
Đây là thẻ img
src: là nguồn của ảnh - alt: là tên của ảnh.
Cả hai đều là thuộc tính của thẻ img
Mỏ neo - Đặt liên kết lại với nhau.
Trở lại!Thẻ a có thuộc tính href
Đây là đầu bảng - tiêu đề! | Thuộc tính th trong thead |
---|---|
Đây là phần thân bảng | Thuộc tính tr trong tbody và td trong tr |
Đây là phần thân bảng 2 | Bảng 2 nè |
có các kiểu type - Checkbox - Radio
Attribute là một thuộc tính trong các thẻ
Có 3 cách sử dụng:
Có 3 cách sử dụng:
Id chỉ được được đặt tên một lần - không thể trùng tên id
Class có thể được đặt trùng tên
.nameClass - .intro - Chọn tất cả thẻ có class=".intro"
.nameClass1.nameClass1 - .intro1.intro2 - Chọn tất cả thẻ có cả nameClass1 và nameClass2.
Ví dụ:
Class này có 2 name: title và heading
.title.heading { color: red } -> Thay đổiClass này có 2 name: title và heading
.nameClass1 .nameClass1 - .intro1 .intro2 - Class 2 là con của class 1. (Lưu ý có dấu cách giữa 2 class)
Ví dụ:
Class này được bọc bởi class cha là box
.box .title { color: red } -> Thay đổiClass này được bọc bởi class cha là box
Kí tự " * " đại diện cho tất cả các thẻ
CSS qua tên thẻ
Kí tự " > " phải trực tiếp là cái thẻ con của class cha
Kí tự " + " Chọn các anh em liền kề phía sau - Đứng phía sau .classĐầu + .classSau.
Kí tự " ~ " Chọn tất cả class phía sau nó.
internal và external - Ai được gọi sau (mới) thì sẽ được ưu tiên cái sau (mới)
Ưu tiên theo số điểm:
Inline - 1000
#Id - 100
class - 10
tag - 1
Equal specificity - các selector giống nhau
Universal selector and inherited - Phổ cập chung
Đây là mô tả - không sử dụng đúng!
Padding - top và bottom - 10px
Padding - right và left - 5px
Đây là thẻ chứa Padding
Đây là mô tả - không sử dụng đúng!
Border-width: 10px
Đây là thẻ chứa Border
Đây là mô tả - không sử dụng đúng!
margin: 10px 0; - Làm tăng khoảng cách thôi ní 🙃
Đây là thẻ chứa Margin
Thuộc tính box-sizing
dùng để quy định cách tính kích thước tổng thể của một phần tử (box).
- Mặc định là content-box: chỉ tính phần nội dung, còn padding
và border
sẽ làm hộp lớn hơn.
- Dùng border-box
: phần tử giữ nguyên kích thước tổng thể (width/height không thay đổi), padding
và border
nằm gọn bên trong.
Đây là thẻ dùng background Image, có 2 thuộc tính CSS chung:
background-size: x y px; -- Size của hình ảnh
background-repeat: no-repeat; -- repeat
(lặp theo chiều dọc và ngang - x, y) -- no-repeat
(không lặp lại) -- repeat x hoặc y
(chỉ lặp lại theo chiều ngang (x-axis) hoặc theo chiều dọc (y-axis)) --
space
(ảnh nền lặp lại nhưng cách đều ra) -- round
(ảnh nền sẽ bị co giãn để lặp lại đủ)
Đây sử dụng các gradient và images để làm ảnh chuyển
linear-gradient(0deg, rgba(1), rgba(2)) -- Dùng gradient
Cái nào khai báo trước thì nó sẽ nằm trên cái khai báo sau! Tìm CSS có tên "backgr-img-gradient" để xem và hiểu rõ!
Có thể kết hợp tuỳ chỉnh
background-position: top right;
background-position: top 20px right 20px;
background-position: x y;
(x là dọc và y là ngang)
vân vân mây mây :))
Ví dụ về relative --
Ví dụ về absolute -- Nếu sử dụng cả 4 top, bottom, left right thì nó sẽ ưu tiên -- top - left -- nhưng đối với thẻ ko chiếm hết màn hình.
Ví dụ về fixed -- Cái nào đứng yên á
Ví dụ về sticky --
Flexbox có 2 trục chính - Main axis và Cross Axis
Ví dụ về Flexbox --
Ví dụ về BEM - Basic
Lever 1 của BEM - Nhớ xem CSS của Trang nhé 👈🏼