Forums

The forums ran from 2008-2020 and are now closed and viewable here as an archive.

Home Forums CSS Using IDs in CSS selectors? Re: Using IDs in CSS selectors?

#118201
Taufik Nurrohman
Participant

Personally I start to use more classes than ID for now. I feel that specifies the name of the class is much easier than ID, particularly for similarity modeling without having to repeat the declaration multiple time in another selectors:

<div id="main" class="col-group text-left clearfix">
<div class="col left-col main pull-left"></div>
<div class="col right-col sidebar pull-right"></div>
</div>

I just use the ID to indicate that the location is a primary location, “This is the primary location, primary section, primary block that is strong, and assertive”. Although I didn’t think to use it in the CSS selector.

Try not to worry with the old CSS in my personal blog which is still widely used ID, but began to use more classes to the customer site/blog.

Personally…