+ 1
Is there always class with div tag in html
9 Réponses
+ 5
No...not necessary...even any tag may have or may not have class. It's depends upon your requirements. If you want to get value or you want to apply css then you can use class or id otherwise no need.
+ 4
Hey I was just kidding !!
+ 3
Still can not understand what p1 is. 😁😆
+ 2
Nope. You need to add one or more. Div is div.
+ 2
River what do you mean ? I don't understand.
+ 2
Wh-ok lol 👍😁
+ 1
No!
+ 1
Making myself alot clearer.Answer was rushed. Sorry. <div> tags don't need exactly 'class' in them. They are used to divide portions of your webpage. For example
<div>
<p1>This is a paragraph</p1>
</div>
Or you could have
<div style="color:blue";>
<p1>This is a paragraph</p1> </div>
Then all the text in this <div> will appear blue.
When you are using class= in a similar fashion, it usually connects to CSS code, and the id= can lead to both Javascript and CSS.
So in conclusion, no, you don't have to all the time.
Sorry about the first post. I have deleted it. I was on my way out abd totally misread it.
Hope this helps now!!
+ 1
<p1> standa for paragraph 1. </p> It's that simple. All the text between those two tags will be in the same paragraph form.