We have the following div elements:
<div>Box 1</div>
<div>Box 2</div>
<div>Box 3</div>
We want to assign a left margin of 2rem
to all but the first div
element.
Approach
div:not(:first-of-type) {
margin-left: 2rem;
}
We have the following div elements:
<div>Box 1</div>
<div>Box 2</div>
<div>Box 3</div>
We want to assign a left margin of 2rem
to all but the first div
element.
div:not(:first-of-type) {
margin-left: 2rem;
}