HTML video tutorial – 82 – html span tag vs div tag
HTML video tutorial – 82 – html span tag vs div tag
HTML div tag vs HTML span tag:
div tag is a paired tag
span tag is a paired tag
div tag is a block level tag
span tag is a inline level tag
Inline tags should exist in context with block level tags.
In modern html every html element should be meaningful. h1 indicates heading, p indicates paragraph, b indicates bold etc. we supposed to use right element for right purpose.
When there is no meaningful tag present for what we want to achieve then we use div tag. For example there is no tag used to create divisions in the page hence we use div tag.
span tag is used to enclose inline contents like text images etc.
=========================================
Follow the link for next video:
HTML video tutorial – 83 – Introduction to css box model
Follow the link for previous video:
HTML video tutorial – 81 – html div tag
======= HTML Questions & Answers ==========
=========================================
source