What is inline and block elements in html? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 1

What is inline and block elements in html?

10th Apr 2017, 7:21 AM
Arusha Shahi
Arusha Shahi - avatar
3 Answers
+ 3
a block level is simply one that starts at the new line and takes all width available .<div> is an example . Inline doesnt start on new line and take only necessary space .<span> <div> example </div> <div> of block <div> <div>this <span> is inline <span> </div> output: example of block this is inline
11th Apr 2017, 1:26 AM
tHe aNonYmOus
tHe aNonYmOus - avatar
+ 13
Inline elements are basically those that do not require a separate section within the paragraphs or section. Block level elements are themselves a separate block or section.. U can add a inline element in block level element but cannot do vice versa.
10th Apr 2017, 8:18 AM
Siddharth
Siddharth - avatar
+ 2
inline elements do not end with a line break... but block elements ends with a line break.. block - p, div, h1 etc inline - a,img
13th Apr 2017, 9:40 AM
Yasiru Nayanajith
Yasiru Nayanajith - avatar