Block in HTML Assignment Help
There are 2 levels of elements
- Block Level
- Inline Elements
Block Elements
It displays on the screen as if it has a line break infront or after them
e.g.
{`< p>, < h1> ... < h6>, < ol>, < ul> ,< dl>, < pre>, < hr/> < bockquote> and`}These tags begin on their own new line and everything after that displays on its own new line
Inline Elements
It displays inside sentences and won’t appear on a new line on own
e.g.
{`< b> ,< u> ,< i> , < strong> , < em> , < sub> < sup>, < big> < li>, < small>, < del>, < code>, < ins>, < cite> ,< kbd>, < dfn> and < var>`}HTML Elements Grouping
To group the HTML tags 2 tags are employed. They are
< div> tag and < span> tag
< div> tag
It is employed with CSS for more meaning
It is employed to generate webpage layout in which various parts are defined like left, right or top, et.,
It won’t offer any visual change on the block
Example
![]()
Output
![]()
< span> tag
The < span> tag
It is employed to group inline elements.
It won’t offer any visual change on the block
It is employed with CSS for more meaning
The key difference between < span> and < div> tag is that < span> tag is for inline elements and < div> tag is for block level elements
Example
![]()
Output
![]()