Jump to content

Recommended Posts

What is the difference between using ID and CLASS? Is it better to use one than another???
For example...

<div id="frame">...</div>  and <div class="frame">...</div>
#frame {
width:777px;
height:100%;
margin-right:0px;
margin-left:0px;
margin-top:0px;
margin-bottom:0px;
padding:0px;
text-align:left;
background-color: #FFF;
}

.frame {
width:777px;
height:100%;
margin-right:0px;
margin-left:0px;
margin-top:0px;
margin-bottom:0px;
padding:0px;
text-align:left;
background-color: #FFF;
}
Link to comment
https://forums.phpfreaks.com/topic/21160-tags/
Share on other sites

[quote author=AndyB link=topic=108507.msg436588#msg436588 date=1158594893]
id should only be used ONCE, class can be used many, many times, in the same file.
[/quote]

and, in addition to that, each element can only carry one id, but each tag could hold many, many classes as well
Link to comment
https://forums.phpfreaks.com/topic/21160-tags/#findComment-94033
Share on other sites

What do u mean by "each element can only carry one id"???

Something along these lines?? <div id="test"> is correct but <div id="test" id="test2"> is incorrect...while <div class="test"> is correct and <div class="test" class="test2"> is correct as well????????
Link to comment
https://forums.phpfreaks.com/topic/21160-tags/#findComment-94036
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.