+ 2
whats the use of <div> in the html and for what purpose it is used and why <i-- is used
explain in detail
3 Réponses
+ 7
Hello RISHABH MEHTA please use the search bar before posting a question :
https://www.sololearn.com/discuss/759632/?ref=app
+ 2
Hello, RISHABH MEHTA !
The tag adds a comment to the document code. The comment text is not displayed on the page. It allows to add other tags inside the comment, the nested comments (when one comment is located inside the other one) is invalid.
Syntax
<!--text-->
Tag <div> is a universal block element and is intended for grouping elements of a document in order to change the type of content through styles. To do this, add a class or id attribute with the class name or identifier. Syntax. <div> ... </ div>.
https://www.sololearn.com/learn/HTML/1027/
https://www.sololearn.com/learn/HTML/1034/
0
A div is a container element of sorts. Tables were used years back to design a layout of your web page whereas now you can use a div tag and attach styling to it.
<div class="divClass">My Div Tag</div>
.divClass {width:100%;background-color:#ff0000;color:#ffffff;text-align:center;margin-top:50px;}