Welcome Guest! (App Version 5.16)
IntroductionHTML Tutorial What is HTML? My First Program in HTML Doctype Doctype Block Elements Inline Elements
Box ModelWhat is Box Model Content in Box Model Padding in Box Model Border in Box Model Margin in Box Model
HTML TagsDiv Tags H1 to H6 Tags Paragraphs Tags Span Tags Bold Tags Italic Tags
HTML UtilitiesAdding Images Adding Hyperlinks Adding Comments Types of Lists Tables Iframes Breaking Lines Horizontal Line
FormsForms in HTML Text-Box Radio Checkbox Select and Option Text Area Button Submit
HTML 5What is new in HTML5 Syntax Changes New Elements & Properties Semantic Tags New Elements New Input Types Graphics Support Canvas SVG Media Support Audio Video Client Side Storage Local Storage Session Storage Indexed DB Web SQL [dep] Cookies API Support Web Worker Web Sockets Service Worker App Cache [dep] SSE Drag & Drop Geolocation
HTML QuizHTML Quiz 1
Block elements are those elements which take full horizontal space on a web page. Their behaviour can be explained as rigid and selfish. For example, even if there is one single word written inside a paragraph, it would still take the full horizontal width & it doesn't matter if 90% of its space is still empty.
Div is often used as a wrapper containing other elements and forming a so called section. (Note: the element of <section> is introduced in HTML5, but before that div used to carry out this functionality for decades.)
<body> <div>This is div1 .</div> <p>This is paragraph1.</p> <div>This is div2.</div> <p>This is paragraph2.</p> </body>
This is paragraph1.
This is paragraph2.