vertical-align is the CSS property that we use to control how inline-level elements (like images and text) are lined up vertically when they sit next to each other. But in a real world case, we mostly use this to vertically align the content of a table cell, whenever that cell has a bigger height than the content.
taught by Tina May
We can align the content to the top of the table cell.
vertical-align:
Oh hey there!
Name | Job Title |
---|---|
Michael Scott | Regional Manager |
Dwight Schrute | Assistant (to the) Regional Manager |
Jim Halpert | Sales |
Pam Beesly | Receptionist |
You miss 100% of the shots you never take.
We can align the content to the middle of the table cell.
vertical-align:
Oh hey there!
Name | Job Title |
---|---|
Michael Scott | Regional Manager |
Dwight Schrute | Assistant (to the) Regional Manager |
Jim Halpert | Sales |
Pam Beesly | Receptionist |
You miss 100% of the shots you never take.
We can align the content to the bottom of the table cell.
vertical-align:
Oh hey there!
Name | Job Title |
---|---|
Michael Scott | Regional Manager |
Dwight Schrute | Assistant (to the) Regional Manager |
Jim Halpert | Sales |
Pam Beesly | Receptionist |
You miss 100% of the shots you never take.
Select any property below and we’ll show you step-by-step how to use the property, with video demo, tips and practical examples you can code for yourself.
<div>
<h2>Oh hey guys!</h2>
<p>What's brewing, good looking?</p>
</div>
What's brewing, good looking?
/* Change your heading color*/
h2 { color: HotPink; }
/* Change your paragraph color*/
p { color: rgba(81, 62, 201, 0.75); }
Try changing the color of each of the following elements. Below we’ve put a heading and a paragraph so test out what happens when you give them a HEX, RGB or HSL values, or one of the 147 color names.
Try these (or anything else!):
Copyright 2023