What is the difference between block level elements and inline elements? | Sololearn: Learn to code for FREE!
Novo curso! Todo programador deveria aprender IA generativa!
Experimente uma aula grƔtis
+ 1

What is the difference between block level elements and inline elements?

28th Apr 2016, 7:23 AM
varsha tyagi
3 Respostas
+ 2
Block level elements always start from a new line, while multiple inline elements can be written into a single line without breaking it. As an example, img is inline, meaning you can add a smiley in the middle of the text without having that smiley show up from new line. P(aragraph) tag is a different story - text will start from a new line each time you add a paragraph tag (p).
16th May 2016, 6:47 PM
Yuri Predborski
Yuri Predborski - avatar
0
note down this ans
25th Jun 2016, 11:16 PM
Shahid Chisty
Shahid Chisty - avatar
0
Difference between inline and block level elements?? === This is a more detailed answer, I hope this helps. In brief, here are the basic conceptual differences between inline and block level elements: Content model- Generally, inline elements may contain only data and other inline elements. You can't put block elements inside inline elements. Formatting- By default, inline elements do not force a new line to begin in the document flow. Block elements, on the other hand, typically cause a line break to occur (although, as usual, this can be changed using CSS). the <div> element has a default CSS property that In this example, theĀ <div>Ā block-level element contains some text. Within that text is aĀ <span>Ā element, which is an inline element. Because theĀ <span>Ā element is inline, the paragraph correctly renders as a single, unbroken text flow. example of Block level elements : <div>, <form> <p> etc. example of Inline elements : <span>, <a>, <img> etc. Example 2: <p>You know, <span> you are Awesome</span></p>
30th Apr 2020, 2:05 AM
Moshiur Rahman Rony
Moshiur Rahman Rony - avatar