I was wondering what the experts do when it comes to writing CSS code. Is it bad to use the tagname.className style? Does inheritance cause a noticeable performance loss? Does it only affect the browser when loading a page or also after? eg: user scrolls down further the page, would poor CSS be a culprit to sluggish scrolling when viewing a page with a lot of rows of results?
CSS Examples:
div.result-row{...}
div.result-row div.photo-column{...}
div.result-row div.main-column{...}
div.result-row div.main-column div.text-row{}
div.result-row div.main-column div.date-row{}
div.result-row div.action-column{...}
vs
div.result-row{...}
div.photo-column{...}
div.main-column{...}
div.action-column{...}
div.text-row{...}
div.date-row{...}
My page is outputting a lot of user posts like this...
<div class="result-row clearfix">
<div class="photo-column">
<img src="..." />
</div>
<div class="main-column">
<div class="text-row">
User's text
</div>
<div class="date-row">
Today
</div>
</div>
<div class="action-column">
<a href="#">...</a>
<a href="#">...</a>
</div>
</div>