Difference between a block-level element and an inline element?
Loading
Difference between a block-level element and an inline element?
Know the answer? Post it — somebody with the same question will find it here.
Sign in to answer this question
It is the same account you read, post and publish with — and you will come straight back to this page.
Vishal YelvePosted Dec 29, 2022, 3:31 PM
Brahma Prakash ShuklaPosted Dec 29, 2022, 11:37 AM
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.
Onkar SharmaPosted Dec 28, 2022, 2:56 PM
Hi Naresh,
Here is the definition of both HTML elements:
Block-level Elements: A block-level element always starts on a new line and takes up the full width available. For example, and
- https://www.w3schools.com/html/html_blocks.asp
- https://www.geeksforgeeks.org/difference-between-block-elements-and-inline-elements/
Inline Elements: An inline element does not start on a new line and occupies as much space as is necessary. For example,
And, to know more about them, visit:
Thanks!
Sachin SinghPosted Oct 18, 2022, 6:31 AM
Block level elements are those which covers the whole width meaning will always come below / above any other element and never be side by side ex:- h2,h1
However inline elements will come inline meaning side by side. ex:- Span