div align

Skills Covered
div align

deprecation

If you have looked at the markup Dreamweaver writes for you, you have already seen the div align tag. Div is short for division and it's used to format a block of text. You can do all sorts of things with the div tag, but we are going to start slow with div align:

<div align="center">Check this out </div>
Check this out

You could use the much simpler center tag: <P align="center">Check this out</P> but it's a good idea to abandon the center tag for one reason: the web standards folks have decided to deprecate it. Deprecation means that a tag is being phased out, and future web browsers won't support it.

Another important difference with using the div tag is that (usually) div does not put a full blank line before or after the block of text. So, let's check out the four ways to align text horizontally using div align: left, center, right, justify.

Here is a block of text aligned to the left, which is the default.
<div align = "center">.... notice no blank lines between div tags?
<div align = "right">..... this is aligned to the right, right?

This block of text is justified. Justify is an interesting word because it can have a few totally different meanings. For instance, justify can be synonymous with "excuse", as when someone justifies a criminal act. It is used in legal cases - murder is against the law, but sometimes a person who commits murder as an act of self defense is justified. We are dealing with a completely different kind of justification. <div align = "justify">uses kerning to stretch out sentences so both the left and the right side are aligned flush to the margins.
Well, that's all for this lesson! Just a quick intro to formatting a block of text with div align. Don't feel like you've wasted time, though, because there will be tons of stuff to learn with div!