Id's and Divs

0 Jeff Gong · September 6, 2015
Do ID's also apply to any other element besides divs?

Post a Reply


Oldest  Newest  Rating
0 benson iruobe · October 10, 2015
please, i am having problems with Div tags . i added 3 divs , one on the left,center and right. but when i minimized my browser d right divs tend to shift. i need help...
0 Craig Charlton · September 13, 2015
<div id = "something">
  <section id = " somethingdifferent">
    <h3 id = "eureka>  I understand now!!! </h3>

id can be used on pretty much any element.... each id on a page must have a different id.... so only one id of that name on the page....

<div class = "kissme">
 <h5>some writing</h5>

<div class = "kissme">
 <h5>different writing</h5>

<div class = "kissme">
 <h5>something else</h5>

class is used for multi items..... so you may want to style the above 3 divs with a background of red... one class selector does all of that class...

think about it as you are 1 and you have your own ID.... but if you are in a class you are one of many....
0 Jack McMullan · September 6, 2015
Yes, you can have ID's on nearly and tag. It's just a way of referencing that specific tag in your CSS. However, it is a HTML standard to only use ID's for you main wrappers/containers, then Class's for the rest of your tags.

I hope that makes sense. If you need more help, just contact me.
0 rajeev man dongol · September 6, 2015
ofcourse any other element,but ID can be called once only as they are known for its uniqneness
  • 1

HTML / CSS / Web Design


Discuss, share, ask, learn and teach HTML5 and CSS3.