addressalign-toparrow-leftarrow-rightbackbellblockcalendarcameraccwcheckchevron-downchevron-leftchevron-rightchevron-small-downchevron-small-leftchevron-small-rightchevron-small-upchevron-upcircle-with-checkcircle-with-crosscircle-with-pluscrossdots-three-verticaleditemptyheartexporteye-with-lineeyefacebookfolderfullheartglobegmailgooglegroupshelp-with-circleimageimagesinstagramFill 1linklocation-pinm-swarmSearchmailmessagesminusmoremuplabelShape 3 + Rectangle 1ShapeoutlookpersonJoin Group on CardStartprice-ribbonShapeShapeShapeShapeImported LayersImported LayersImported Layersshieldstartickettrashtriangle-downtriangle-uptwitteruserwarningyahoo

Chicago Web Professionals Meetup Group Message Board › Don't Use IDs for CSS

Don't Use IDs for CSS

Dennis D.
deconspray
Vernon Hills, IL
Post #: 166
Just sharing. Came across several discussions on this. It appears to resolve issues I've had with CSS specificity.

Basically, use CSS classes only for CSS. Use IDs primarily for Javascript.

The reason is straightforward. IDs can create specificity issues when used in selectors for CSS. There's also debate on performance impact. However, using IDs for JavaScript/jQuery is preferred for selecting elements in your markup.

Here's the resource for this info:
http://oli.jp/2011/ids/­
Powered by mvnForum

Our Sponsors

Sign up

Meetup members, Log in

By clicking "Sign up" or "Sign up using Facebook", you confirm that you accept our Terms of Service & Privacy Policy