0

A basic CSS question

What are the difference between <div> and <p> and <span> and <a>

31st Dec 2019, 7:35 AM
Hasan
Hasan - avatar
2 Answers
+ 7
<div> is a container, <p> paragraph, <span> container (in terms of layout it is a lowercase container), <a> is a link, each tag performs its function.
31st Dec 2019, 7:49 AM
Anna/ĐĐœŃ
Anna/ĐĐœŃ - avatar
+ 3
In addition I would say that div and p tags are block elements, span and anchor (a) are inline elements. Paragraph differs from div by top padding, i.e. it has top padding, and because of it they don't stick to each other. Anchor differs from span cause it has blue color and underline
31st Dec 2019, 7:58 AM
Timur Myngbay
Timur Myngbay - avatar