Answers for "css first element"

CSS
31

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 
}
Posted by: Guest on March-03-2020
4

css first

:first-of-type {
	//styles here
}

:first-child {
	//styles here
}

:nth-child(1) { //the benefit of this is you can do it for 2nd, 3rd etc...
	//styles here 
}
Posted by: Guest on March-03-2020
6

css first element

p:first-child {
  font-size: 1.5em;
}
Posted by: Guest on March-11-2020
3

css first h element

p:first-of-type {
  font-size: 1.25em;
}
Posted by: Guest on March-11-2020
2

select first div css

#content div:first-child {
/*css*/
}
Posted by: Guest on May-08-2020
1

select first div css

#content_id div.class_name:first-child {
	/*your style*/
}
Posted by: Guest on September-11-2020

Browse Popular Code Answers by Language