About Lesson
Definition:
Unlike block-level elements, inline elements do not start on a new line. They begin within a line and only take up as much width as it is necessary. Inline elements are included as a part of the main text.
Inline elements commonly contain other inline elements, or they can be empty.
Types of Inline Elements:
Some common Inline elements are:
- Anchor (a)
- Image (img)
- Button (button)
- Input (input)
- span (span)
Example:
HTML
<!DOCTYPE html>
<html>
<head>
<link rel="icon" type="image/png" href="logo-dark.png">
</head>
<body>
<h1>HTML Inline elements</h1>
<span>span is inline element</span>
<span>Image is inline element</span>
<img src="R.png"/>
<img src="chip.png" height="400px"/>
<button type="button">Click Me</button>
<button type="button">Click Me</button>
</html>