Skip to main content

Difference Between ID and Class



 DOWNLOAD Output File

ID's area unit distinctive

Each component will have only 1 ID
Each page will have only 1 component therewith ID
When I was 1st learning these things, I detected over and over that you simply ought to solely use ID's once, however you'll use categories over and over. It essentially went in one ear and out the opposite as a result of it plumbed a lot of sort of a sensible "rule of thumb" to ME instead of one thing extraordinarily necessary. If you're strictly AN HTML/CSS person, this perspective will persist as a result of to you, they extremely do not appear to try to to something completely different.

Here is one: your code won't pass validation if you employ constant ID on quite one component. Validation ought to be necessary to all or any folks, in order that alone may be a huge one. We'll re-evaluate a lot of reasons for individualism as we have a tendency to continue.

Classes don't seem to be distinctive

You can use constant category on multiple components.
You can use multiple categories on constant component.
Any styling info that must be applied to multiple objects on a page ought to be through with a category. see example a page with multiple "widgets":

Comments

Popular posts from this blog

How To Create Image Gallery In HTML Tutorial Part10

Create a photograph gallery, wizard vogue, Associate in Nursingd plant it into any website that accepts hypertext markup language or publish it as an RSS feed. it's conjointly totally compatible with many CMS programs like WordPress, Drupal, Joomla, TypePad, MediaWiki, Ning, Blogger, vBulletin, Weebly, WordPress letter of the alphabet and crony Press. JQuery, Flash templates to make your image galleries. additionally to specifications, a live demo is provided for all listed example. Because plenty of users asked within the comments wherever they will realize a gallery with navigation and slideshow, you'll check my newest tutorial with a whole hypertext markup language image gallery here, which incorporates navigation arrows, bullets, slideshow and thumbnails. Check it out, or if you do not want this advanced image gallery, you'll simply continue reading the straightforward hypertext markup language image gallery beneath the video.   DOWNLOAD  Output File

Live Image Upload, Crop, Rename and Resize using PHP

11 Creativity Text Styles and Hover Effects CSS3 | Tutorial SVG masking ...