+ 1

How does one understand divs in html and css when they are multiple?

6th Apr 2017, 10:10 AM
David Auna
David Auna - avatar
2 Answers
+ 5
I'm not sure if I understand your question correctly but if you are having problems with identifying multiple divs then make use of the "id" attribute. The "id" attribute, uniquely identifies tags and you can also use the "class" attribute to give same specifications to a group of tags. Example (HTML, CSS): <!DOCTYPE html> <html> <head> <title>Example</title> <style type="text/css"> #gavin{ //Is Awesome! } .people{ //Are Lame! } </style> </head> <body> <!--example of id attribute--> <div id="gavin"></div> <!--example of class attribute--> <div class="people"></div> <div class="people"></div> <div class="people"></div> <div class="people"></div> <div class="people"></div> <div class="people"></div> </body> </html>
6th Apr 2017, 10:24 AM
Ghauth Christians
Ghauth Christians - avatar
+ 2
By giving ids to the divs...still in CSS you also give the same ids
7th Apr 2017, 7:43 AM
Maureen Murugi
Maureen Murugi - avatar