An Interest In:
Web News this Week
- April 1, 2024
- March 31, 2024
- March 30, 2024
- March 29, 2024
- March 28, 2024
- March 27, 2024
- March 26, 2024
July 19, 2021 05:44 pm GMT
1.
2.
3.
Original Link: https://dev.to/snkds/css-display-inline-block-and-inline-block-3kkm
CSS Display inline, block, and inline-block
In this post, we will discuss the difference between three common CSS display properties:
inline
block
inline-block
1. inline
Inline elements do not start from a new line. You can not set width
or height
values for them. Even if you set a value, it won't have any effect.
Examples:
<span>
<a>
<img>
<u>
<e>
<strong>
2. block
Block elements always start from a new line. They take up the whole space available to them. You can set their width
and height
.
Examples:
<div>
<header>
<footer>
<section>
<main>
<aside>
<h1>
<p>
3. inline-block
These elements are formatted just like inline
, but you can set their width
and height
, similar to block
.
Examples:
<button>
<select>
Hope this helped
Original Link: https://dev.to/snkds/css-display-inline-block-and-inline-block-3kkm
Share this article:
Tweet
View Full Article
Dev To
An online community for sharing and discovering great ideas, having debates, and making friendsMore About this Source Visit Dev To