+ 1
I little confused between div and class plz explain
6 odpowiedzi
+ 2
div is the container. class is the name of that container.
<div class="containername">
...
</div>
+ 1
Div is used to group things, class is used to format this div with colors, nice fonts, etc...
0
<div class="you">
</div>
You can select the by (.you) else if you use div in css
the whole div element of html will change. 😊
0
Div is like a building, while class and Id are like bed room
0
<div> is used in html and in css. I you use in html it means "container" while in css it is the reference to this " container". if you use < div class="test"> it means that in the css file it is div test{ some style = value;}. So the class is a reference to a style in css while div is a " container" for html. Also if you have in css #div {.......;} it means that all the <div> " containers" in the html file will change according to the values in css file. Hope it helps.
0
<div> is a settingless container.
class(.foo) in de CSS file defines settings,
which you then give to the <div> container.
Example:
.box {
width: 100px;
height: 100px;
}
<div class="box"> lorem ipsum </div>
The "lorem ipsum" part is now inside a 100px X 100px box.
If you want to check this, just add "border: 5px solid black;" to the ".box" class.
This wil draw a 5px black line around the box.