Pseudo-class selectors
selector:pseudo-class {
property: value;
}Pseudo-class
Ý nghĩa
//Phần tử <li></li> đầu tiên của thẻ cha <ul></ul> sẽ được style
ul {
li:first-child {
font-weight: bold;
color: blue;
}
}Last updated
selector:pseudo-class {
property: value;
}//Phần tử <li></li> đầu tiên của thẻ cha <ul></ul> sẽ được style
ul {
li:first-child {
font-weight: bold;
color: blue;
}
}Last updated
// Style cho những thẻ <li></li> nằm bên trong thẻ <ul></ul> mà có số thứ tự chẵn
ul {
li:nth-child(even) {
color: blue;
}
}//Style cho thẻ <p></p> mà không chứa class = "text"
p:not(.text) {
color: aqua;
}