introduction to HTML elements
Inline Elements Block Elements ComparisonThis is a paragraph element
This is a blockquote element
Header 1 | Header 2 |
---|---|
Data 1 | Data 2 |
This is a code element
This is a code element
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>
</head>
<body>
</body>
</html>
Block Elements | Inline Elements |
---|---|
Take up the full width available | Take up only as much width as necessary |
Start on a new line | Do not start on a new line |
Can contain other block and inline elements | Can only contain other inline elements |
Examples: <div>, <p>, <h1> to <h6>, <ul>, <ol>, <table> | Examples: <span>, <a>, <strong>, <em>, <code>, <img> |