9. Inline & Block Elements : HTML

Inline & Block Elements

Inline & Block Elements

Inline components are those components that just consume the space limited by the labels characterizing the component, rather than breaking the order of the component. Then again, block-level components occupy the whole room of their parent component.

On the off chance that we compose any text in the section label like this-

<p>This is a paragraph</p>

<p>This is likewise a paragraph</p>


Or then again

<p>This is a paragraph</p> <p>This is likewise a paragraph</p>


In both the above models, we will see the yield in both various lines, not in a similar line. We need both the texts in a similar line however it isn't the case. It is because the passage tag is a square component. The Block component implies that it will take the full width of a solitary line and doesn't permit some other substance to fit in it. Be that as it may if we compose both the texts between the <span> labels like-

<span>This is a paragraph</span> <span>This is likewise a paragraph</span>

Then, at that point, we see that both the texts will show up in a similar line. It is because the <span> tag is an inline component. It permits every one of the components in a similar line. inline components will take just their piece of text while the square component will take the entire width of the line.

Anchor <a> labels likewise acts like an inline component.

Post a Comment

0 Comments