-
Differences between using "id" & "class"
What is the difference between...
#something
{
}
<div id="something"></div>
.somethingelse
{
}
<div class="somethingelse"></div>
When would one be used over the other and vice/versa?
-
-
The above item is known as ID Selector. The idea is you can use this ID Selector only on a single HTML element as its ID. ID is supposed to be a unique value within a web page. In other words you can use the above mentioned item only once.
The above is the class selector. The advantage of this over the ID selector is you can re-use this class on any number elements using the 'class' attribute of that element which needs to use the CSS class.
-
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
Bookmarks