Aligning Text With Graphics Using HTML

Placing Graphics Above or Below Text

In this example, the graphic is placed on its own line, between two lines of text.

CD's

No special HTML commands are required.

 

Placing Graphics Beside Text

Placing graphics beside text requires using the HTML ALIGN command. ALIGN provides ten options for aligning graphics with text:

  • default
  • left
  • right
  • top
  • text top
  • middle
  • absolute middle
  • baseline
  • bottom
  • absolute bottom

Many of these options look the same. For different effects, you may want to experiment with where you place the cursor in the text when inserting a graphic.

 

CD'sThis is the default graphic alignment with cursor placed at the beginning of the first line of text. It looks the same as the bottom, baseline and absolute bottom alignments. The HTML code for this alignment is <IMG SRC="cds.gif">. The ALIGN command is not used.

 

CD's This is the left graphic alignment with cursor placed at the beginning of the first line of text (it's the one you should use for drop caps). Using this alignment, text begins at the top of the graphic and borders it to the bottom. If the text is long enough, it wraps around the bottom of the graphic. The HTML code for this alignment is <IMG SRC="cds.gif" ALIGN="LEFT">. (Note: if your paragraph is not long enough to reach the bottom of the graphic, text from the paragraph that follows it will be pulled up to fill the void. To avoid this, add the HTML code <BR> after the text. Each <BR> is equal to one empty line.)

 

CD's This is the right graphic alignment with cursor placed at the beginning of the first line of text. Using this alignment, text begins at the top of the graphic and borders it to the bottom. If the text is long enough, it wraps around the bottom of the graphic. The HTML code for this alignment is <IMG SRC="cds.gif" ALIGN="RIGHT">. (Note: if your paragraph is not long enough to reach the bottom of the graphic, text from the paragraph that follows it will be pulled up to fill the void. To avoid this, add the HTML code <BR> after the text. Each <BR> is equal to one empty line.)

 

CD'sThis is the top graphic alignment with cursor placed at the beginning of the first line of text. It looks the same as the text top alignment. Notice that the first line of text is aligned with the top of the graphic and the rest of the text appears below it. This might be useful for a short caption, aligned at the top. The HTML code for this alignment is <IMG SRC="cds.gif" ALIGN="TOP">.

 

CD's This is the middle graphic alignment with cursor placed at the beginning of the first line of text. It looks the same as the absolute middle alignment. Notice that the first line of text is aligned with the middle of the graphic and the rest of the text appears below it. This might be useful for a short caption, aligned at the middle. The HTML code for this alignment is <IMG SRC="cds.gif" ALIGN="MIDDLE">.

Return to Article