0
Inline vs block elements
Does inline mean within opening and closing of 1 tag? and block means it is having multiple elements within it?
3 Respostas
+ 3
Example for inline👇
<h1>Text<u>Underlined</u></h1>
Here <u> is inline because it adding styles or reference
to a text without starting a new line in the page.
Just think about ,
• <i> - makes text italic
• <a> - makes text as link
• <font> - make text styles
This elements are works as inline in a code...
Example for block👇
<h1></h1>
<p>Paragraph </p>
Here <p> element starting in a new line after <h1> element.. (Right??).So <p> element is block level..
Also <h1> is a block level.
Think about ,
• <h2> - heading
• <hr> - horizontal line
• <div> - section blocks
+ 1
No.
Block elem occupy all line and start from a new line
An inline element does not start on a new line and only takes up as much width as necessary.
https://www.w3schools.com/html/html_blocks.asp
+ 1
Thank you both, really appreciate your responses, I understand now