Adding Images to a Web Page with HTML

If you downloaded this tutorial the images that you need are in an htdocs/images folder located in the tutorial folder.

If you are working online and haven't created your images folder within your htdocs folder do that now.

If you haven't downloaded the zip file that contains the images for this site, do it now and move the images into the images folder.

You can't complete this lesson if you don't have the images. Image Download Page

Pictures or images are added to a web page using the image tag.

In its most basic form the tag looks like this: <img>

The image tag is one of the few HTML tags that does not use a closing tag.

You'll use the source attribute to tell the the browser what image to use. It looks like this: src="".. We need to tell the browser what image to use and where to find it. The name of our image is strawberry.jpg and it is located in the images folder.

Our image tag will look like this:
<img src="images/strawberry.jpg">

Copy the code and paste it between the first set or left cell tags in the table.

Save the changes and look at the page in your browser.

Note:
If you aren't closing your browser, just right click on the page and click Refresh or Reload to see changes.

You should see a large strawberry on the left and on the right the words My First Web Page

The code will look like this:
<table>
<tr>
<td id="left"><img src="images/strawberry.jpg"></td>


Making Adjustments

More on Images
We're omitting some necessary attributes of the image tag to speed the learning process. When you get some experience, you should supply the width , height and alternate text for the image. The code for the strawberry jpg image would look like this: <img src="images/strawberry.jpg" width="400" height="304" alt="Strawberry"> . Set image margins and borders with style sheets.

Our header tag is not at the top of the page where we want it to be so we need to add an attribute to our table row tag.

Vertical alignment can be applied to the row tag using our style sheet.

Our header tag doesn't seem to be aligning properly so we want to set a width setting on our table. This can also be done using the style sheet.

Open the style sheet and add these 2 lines of code.
table {width: 100% }
tr {vertical-align: top }

Save the changes to the style sheet and look at the web page in the browser. You may need to click the reload or refresh button to see the changes.

The Heading should move to the top of the page and to the right. It will now center as we add paragraph text to the page.

Take a short quiz on the information you just learned.

Let's add a few paragraphs.


Free Business Web Hosting

If you are building a website for a business or organization, you can put it online for free at Microsoft® Office Live Small Business. You can create your website with HTML and upload it or use their tools and build it online. Take your business online with Microsoft® Office Live Small Business. Get started for FREE! Take the TOUR!

Create Web Sites without Learning Code

Create web sites online without learning any code using Yahoo's simple but powerful Site Solution builder.
Try the Site Solution Demo

Sitebuilder 2.6 is even better than previous versions of Yahoo's downloadable builder. Download it to your PC and create a web site with all the bells and whistles.

Start today and SAVE 25% on your first 3 months.

Get everything you need for a great web site with Yahoo! Web Hosting - 25% off





Add a Heading to a Web Page with HTML

Property of
Net Success 2000 Plus Inc
Po Box 1508
Somerset KY 42502
Last Modified: October 7, 2008

Add a Paragraph to a Web Page with HTML

Home

HTML Tutor
Beginner
HTML Basics
Add a Heading
Add a Paragraph

Intermediate
Phase I
Getting Started
Basic HTML Page
Creating Columns
CSS
Color
Headings
Images
Paragraphs
Site Heading
Linking

Advanced
Phase II
Start Phase II
Editing Pages
Change Appearance
Summary

Helps
Tag Glossary
Finished Code
Image Download
Color Tool
Hex Code Chart
Free Web Templates
Free Heading Graphic
Free Backgrounds
Put It on the Web
Quizzes
Your Questions

HTML Editors
Overview
NoteTab Light
Webbuilder

Online Builder Tutorials
Soholaunch
SiteReptile
SiteSTUDIO

Other Helps
Flash Web Sites