Welcome to Bucaro TecHelp!

Bucaro TecHelp
Maintain Your Computer and Use it More Effectively
to Design a Web Site and Make Money on the Web

About Bucaro TecHelp About BTH User Agreement User Agreement Privacy Policy Privacy Site Map Site Map Contact Bucaro TecHelp Contact RSS News Feeds News Feeds

Victims of Sandy Hook

Stop the Slaughter of Innocents. Congress is bought and paid for by gun lunatics and gun promotion groups. If you want to live in a safe America, help buy Congress back for America. Send a donation to Mayors Against Illegal Guns, 909 Third Avenue, 15th Floor New York, NY 10022

Aligning an Image on Your Web Page

You place an image on a webpage using the <img src="imagename" /> tag. An img tag creates an inline box. This means the the browser renders the image along with any other inline elements (like text) from left to right, top to bottom.

This is some text. This is some text. This is some text. This is some text. This is some text. This is some text. This is some text. This is some text. This is some text. This is some text.

By default the baseline of the image is placed on the same baseline as the text. However you can set the align attribute to "bottom", "middle" or "top" to change where the baseline of the image will be located relative to the baseline of the text.

align attribute:

align="bottom" - default
align="top"
align="middle"
align="left"
align="right"

This is some text. This is some text. This is some text. This is some text. This is some text. This is some text. This is some text. This is some text.

<img align="middle" src="cherry.jpg" />

This is some text. This is some text. This is some text. This is some text. This is some text. This is some text. This is some text. This is some text. This is some text. This is some text.

<img align="top" src="cherry.jpg" />

As you can see from the examples above, if you set the align attribute to "middle" or "top", it causes some space between the lines of text. If this is undesirable, you might use some other layout elements, such as placing the image and the text inside table cells.

This is some text. This is some text. This is some text. This is some text. This is some text. This is some text. This is some text. This is some text. This is some text. This is some text.

<img align="left" src="cherry.jpg" />

This is some text. This is some text. This is some text. This is some text. This is some text. This is some text. This is some text. This is some text. This is some text.This is some text.

<img align="right" src="cherry.jpg" />

As you can see in the examples above, if you set the align attribute to "left" or "right", it causes text to wrap next to the image. This can cause a problem when text that you don't want to wrap continues to wrap. To stop the text from wrapping, use a break tag (<br>) with its clear attribute set to the same value as the <img> tags align attribute. An example is shown below.

<br clear="left" />

Or you can use <br clear="all" /> to clear any previous align setting.

RSS Feed RSS Feed


Follow Stephen Bucaro Follow @Stephen Bucaro


Web Design Sections

Fire HD
[Site User Agreement] [Privacy Policy] [Site map] [Search This Site] [Contact Form]
Copyright©2001-2016 Bucaro TecHelp 13771 N Fountain Hills Blvd Suite 114-248 Fountain Hills, AZ 85268