HTML-
<div class="parent-class">
<div class="pagination"></div>
<a>Example with font-size 30px</a>
</div>
You need the following CSS classes:
.parent-class { }
.parent-class .pagination {
font-size: 10px
}
.parent-class a {
font-size: 30px
}
...............
NOTE. The div position with the class .pagination and "a" -tag is not important in this case. They will be affected by the CSS rules that you specify, regardless of where they are inside the div.parent div class. If you need a selector that only matches children, when they are DIRECT descendants of this element, you need something like this :
.parent-class { }
.parent-class > .pagination {
font-size: 10px
}
.parent-class > a {
font-size: 30px
}
...............
source
share