+ 2
Hi everbody) What is "<div>" I actually can t understand
3 Respostas
+ 2
It's a "divider". Almost like a blank element to do with what you want, and it can make it easier to break up your HTML into logical sections.
For example, I could have a div that surrounds the title cars of my webpage, and another for the content. And I could wrap both in another div in case I want to select both with javascript or css:
<body>
<div id="container">
<div id="title"><h1>Webpage</h1></div>
<div id="content">
<article>SoloLearn is fun</article>
<footer>Follow @SoloLearn</footer>
</div>
</div>
</body>
It's really up to you how use it, but again, it makes selecting specific items with css and javascript a little easier.
<span> is the same thing, but div is a block element by default, while span is an in-line element.
+ 1
Hi!
It's a bookstore to sort your books (a block element to hold some other elements).
0
Thanks very much😊