Vertically aligning text


show more Vertically aligning text provides you with in-depth training on Web. Taught by Eric Meyer as part of the CSS Web Site Design show less
please wait ...

Vertically aligning text

In the last video we talked about horizontal alignment of text and centering and right and left and that sort of think. You also vertically align text, although what's really more the case is that you can vertically align elements within text. As an example, let's take a look in our markup. Our h1 element, the about tea history has a B element inside of it which is used generally to change the color. The about tea is the B element and it sort of uses a stylistic hook, we're going to use it as a hook to look at vertical alignment.

So I'm going to go up here in our style sheet, I'm going to say h1 b, that's the boldface element that's inside h1 like the one that we're dealing with. So what we're going to say is vertical-align sub. This is sub as in subscript. So keep your eye in the about tea bit. Notice how it shifted down. That's subscripting. Effectively what a vertical line sub means is push this element down as though it was a subscript.

Doesn't sa...

Vertically aligning text
Video duration: 4m 22s 6h 8m Intermediate

Viewers:

Vertically aligning text provides you with in-depth training on Web. Taught by Eric Meyer as part of the CSS Web Site Design

Subject:
Web
Software:
CSS
Author:
please wait ...