Changed space to width (#23147)
It said that block level elements fill up the container's space. They only fill the width.
This commit is contained in:
committed by
Manish Giri
parent
e017f5474a
commit
5e91cd7553
@ -3,15 +3,15 @@ title: Block and Inline Elements
|
|||||||
---
|
---
|
||||||
## Block and Inline Elements
|
## Block and Inline Elements
|
||||||
|
|
||||||
Let us understand them using below examples :
|
Let us understand them using below examples:
|
||||||
|
|
||||||
#### Code Sample with Output :
|
#### Code Sample with Output :
|
||||||

|

|
||||||
|
|
||||||
#### Block-Level Element :
|
#### Block-Level Element :
|
||||||
A Block-level element occupies the entire space of the parent(container) such as `<div>` and `<p>` in the example .
|
A Block-level element occupies the entire width of the parent (container) such as `<div>` and `<p>` in the example.
|
||||||
|
|
||||||
Note that both `<div>` and `<p>` start from a new line each time, forming a **block-like** structure. Block-level elements begin on new lines.
|
Note that both `<div>` and `<p>` start from a new line each time, forming a **block-like** structure. Block-level elements *always* begin on new lines.
|
||||||
|
|
||||||
|
|
||||||
Common **block-level elements** are `<div>`,`<p>`,`<article>`,`<section>`,`<figure>`,`<footer>` etc.
|
Common **block-level elements** are `<div>`,`<p>`,`<article>`,`<section>`,`<figure>`,`<footer>` etc.
|
||||||
@ -19,7 +19,7 @@ Common **block-level elements** are `<div>`,`<p>`,`<article>`,`<section>`,`<figu
|
|||||||
|
|
||||||
|
|
||||||
#### Inline Element :
|
#### Inline Element :
|
||||||
Inline as the name says "included as a part of the main text and not as a separate section". Inline elements occupy the space as needed within the space defined by the main element. Unlike block-level elements, they do not begin on new lines.
|
Inline as the name says "included as a part of the main text and not as a separate section". Inline elements occupy the width as needed within the space defined by the main element. Unlike block-level elements, they do not begin on new lines.
|
||||||
|
|
||||||
Some of the **inline elements** are `<a>`,`<span>`,`<img>`,`<code>`,`<cite>`,`<button>`,`<input>` etc.
|
Some of the **inline elements** are `<a>`,`<span>`,`<img>`,`<code>`,`<cite>`,`<button>`,`<input>` etc.
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user