Applying same style to multiple child divs
Here is my html
<div id="d1">
<div>1</div>
<div>2</div>
<div>3</div>
<div>4</div>
</div>
<div id="d2">
<div>1</div>
<div>2</div>
<div>3</div>
<div>4</div>
</div>
In the CSS, I have following.
#id1 > div {
border: 1px solid white;
width: 100px;
height: 50px;
margin: 5px;
}
#id2 > div {
border: 1px solid white;
width: 100px;
height: 50px;
margin: 5px;
}
I wanted to combine it in following values.
#id1 > div #id2 > div {
border: 1px solid white;
width: 100px;
height: 50px;
margin: 5px;
}
But this does not work. I can add a class and apply to all 8 divs but I am
wondering if there is any better way of getting this done.
No comments:
Post a Comment