Div tags | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 1

Div tags

Can someone pls tell me the different types of <div>tags and what they are for🙏

8th Jun 2022, 9:54 PM
Olumide Nifemi
8 Answers
+ 1
You've learned HTML. Learn CSS next. Then you will understand.
9th Jun 2022, 6:58 AM
Chris Coder
Chris Coder - avatar
+ 2
Chris Coder oh I thought it was under the HTML courses. Thanks so much🙏
9th Jun 2022, 7:00 AM
Olumide Nifemi
+ 1
And can someone do the same for the <span> tags too🙏
8th Jun 2022, 9:57 PM
Olumide Nifemi
+ 1
There is only one div tag and one span tag div is a special tag that does not have any style to it, so you can make your own, this one behave as a block. span tag is just like the div tag, but can be used inline, for text
9th Jun 2022, 12:37 AM
Apollo-Roboto
Apollo-Roboto - avatar
+ 1
Hi Olumide Nifemi div is short for division, It is a none Semantic block level element. divs were often used to create sections in a webpage. Now with HTML 5 we don't see them as much anymore because we have more more symantic tags. Such as main, section and article which replaces divs to give it meaning. Span is a none semantic inline element. it is used to style inline elements. Such as text in a p element. I have an example. https://code.sololearn.com/WXpdoa1ifG1s/?ref=app
9th Jun 2022, 1:12 AM
Chris Coder
Chris Coder - avatar
+ 1
Chris Coder thank you but what I meant was for example <div class>="#" or <div id>= "#" , what do you call the class or the id beside the <div>
9th Jun 2022, 6:51 AM
Olumide Nifemi
+ 1
Apollo-Roboto thank you but what I meant was for example <div class>="#" or <div id>= "#" , what do you call the class or the id beside the <div>
9th Jun 2022, 6:52 AM
Olumide Nifemi
+ 1
You call it what ever you want to <div class="classname"> <div Id="Idname">
9th Jun 2022, 6:56 AM
Chris Coder
Chris Coder - avatar