+ 1

Why are we using a not div. What is different between <div> and <a>. When can we used eaxh

aĀ { Ā  text-decoration:Ā none; } and divĀ { Ā Ā text-align:Ā justify; }

8th Jan 2022, 1:22 PM
Ayoola Abiodun
Ayoola Abiodun - avatar
4 Answers
+ 2
<a> is an anchor element to use for creating web pages and linking them with each other by using an attribute "href". Whereas <div> is used as a container in our HTML code, it defines as a division or you can say a section in our HTML code. It is used to group all of the other elements of our web page to maintain it.
8th Jan 2022, 1:57 PM
Krish
Krish - avatar
+ 2
TheĀ <div>Ā tag defines a division or a section in an HTML document. TheĀ <div>Ā tag is used as a container for HTML elements - which is then styled with CSS or manipulated with JavaScript. TheĀ <div>Ā tag is easily styled by using the class or id attribute. Any sort of content can be put inside theĀ <div>Ā tag!Ā  Note:Ā By default, browsers always place a line break before and after theĀ <div>Ā element // TheĀ <a>Ā tag defines a hyperlink, which is used to link from one page to another. The most important attribute of theĀ <a>Ā element is theĀ hrefĀ attribute, which indicates the link's destination. By default, links will appear as follows in all browsers: An unvisited link is underlined and blue A visited link is underlined and purple An active link is underlined and red
8th Jan 2022, 1:57 PM
NEZ
NEZ - avatar