Initializing Core...
Initializing Core...
Operational
Block Elements = Full width, new line
Inline Elements = Content width, same line
Block elements always start on a new line and take full width.
| Element | Purpose |
|---|---|
<div> | Container |
<h1>-<h6> | Headings |
<p> | Paragraphs |
<ul>, <ol> | Lists |
<li> | List items |
<section> | Content sections |
<article> | Independent content |
<header>, <footer> | Page structure |
<nav> | Navigation |
<div>This is a container</div><p>This is a paragraph</p><h1>This is a heading</h1>
Browser Output:
┌─────────────────────────────────────────┐
│ This is a container │
└─────────────────────────────────────────┘
┌─────────────────────────────────────────┐
│ This is a paragraph │
└─────────────────────────────────────────┘
┌─────────────────────────────────────────┐
│ THIS IS A HEADING (large & bold) │
└─────────────────────────────────────────┘
Inline elements flow with text and take only needed space.
| Element | Purpose |
|---|---|
<span> | Generic inline container |
<a> | Links |
<strong> | Bold text |
<em> | Italic text |
<img> | Images |
<code> | Code snippets |
<br> | Line break |
<input> | Form inputs |
<button> | Buttons |
<p>This is <strong>bold</strong> and <em>italic</em> text with a <a href="#">link</a>.</p>
Browser Output:
This is bold and italic text with a link.
↑ ↑ ↑
bold italic blue link
<h1>Title</h1><p>Paragraph text here</p><div>Container content</div>
Browser Output:
┌─────────────────────────────────────────┐
│ TITLE (very large & bold) │
└─────────────────────────────────────────┘
┌─────────────────────────────────────────┐
│ Paragraph text here │
└─────────────────────────────────────────┘
┌─────────────────────────────────────────┐
│ Container content │
└─────────────────────────────────────────┘
<span>Text</span><strong>Bold</strong><em>Italic</em><a href="#">Link</a>
Browser Output:
TextBoldItalicLink (all on one line)
↑ ↑ ↑
bold italic blue
<div>Block container with <strong>bold</strong> and <em>italic</em> inline text.</div><p>Another paragraph with a <a href="#">clickable link</a>.</p>
Browser Output:
┌─────────────────────────────────────────┐
│ Block container with bold and italic │
│ inline text. │
└─────────────────────────────────────────┘
┌─────────────────────────────────────────┐
│ Another paragraph with a clickable link │
└─────────────────────────────────────────┘
/* Change behavior */span { display: block; } /* Inline → Block */div { display: inline; } /* Block → Inline */img { display: inline-block; } /* Hybrid */
block - Full width, new lineinline - Content width, same lineinline-block - Content width but can set width/heightnone - Hide element| Type | Width | New Line | Can Contain | Margins/Padding |
|---|---|---|---|---|
| Block | Full | ✅ Yes | Block + Inline | All sides |
| Inline | Content | ❌ No | Inline only | Left/Right only |
<div><p>Text with <strong>bold</strong> word</p></div>
Browser Output:
┌─────────────────────────────────────────┐
│ Text with bold word │
└─────────────────────────────────────────┘
<strong><div>Block inside inline</div> <!-- Wrong! --></strong>
display to change behavior