css first child
:first-child {
//styles here
}
:nth-child(1) { //the benefit of this is you can do it for 2nd, 3rd etc...
//styles here
}
css first child
:first-child {
//styles here
}
:nth-child(1) { //the benefit of this is you can do it for 2nd, 3rd etc...
//styles here
}
first child element javascript
Both these will give you the first child node:
console.log(parentElement.firstChild); // or
console.log(parentElement.childNodes[0]);
If you need the first child that is an element node then use:
console.log(parentElement.children[0]);
css first child
/*CSS First - forth child*/
:first-child {}
:nth-child(2){}
:nth-child(3){}
:nth-child(4){}
Copyright © 2021 Codeinu
Forgot your account's password or having trouble logging into your Account? Don't worry, we'll help you to get back your account. Enter your email address and we'll send you a recovery link to reset your password. If you are experiencing problems resetting your password contact us