How to Define Image Size Using HTML Programming

Hypertext Markup Language (HTML) is a computer language that is used to create web pages. Websites and web pages are written in HTML code. Whether you are setting up a personal web page or a business web page, learning HTML code can be very beneficial. Knowing how to use the codes can help you manipulate your page settings. HTML documents contain plain text and have the extension .html or .htm extension. You can define the width and height of your image on your page. Viewers can view your webpage more quickly because the web browser will not have to calculate the size of the image and the page will load more quickly.

Instructions

    • 1

      Determine the size of your image. You can determine this by using an image editing program.

    • 2

      Write down the width and height of your image.

    • 3

      Start your word processor or text editor that you will use to create your web page.

    • 4

      Type WIDTH=? inside of the IMG tag, directly after the name of the image name that you will be using on your page. Replace the question mark with the width of the image in pixels. Press the spacebar.

    • 5

      Type HEIGHT=? after WIDTH=? Replace the question mark with the height of the image in pixels. Your text should look like the example below:<HTML><HEAD><TITLE>This is your title</TITLE></HEAD><BODY BACKGROUND=“photo.jpg”><CENTER><IMG SRC=“photo.jpg” WIDTH=180 HEIGHT=110></CENTER><P>This is your text.</P><P>This is more text for your page.</P></BODY></HTML>

    • 6

      Open a new web browser to verify that your web page displays the background image correctly. The image should be repeated to fill the entire page. To display your page you may use a browser, such as Internet Explorer. To open your web page in the browser, click the file button along the menu bar, click open. The open dialog box appears. Click Browse to locate your web page in the location that it is saved. Choose the web page that you wish to open. Your web page will appear in the browser.

Tips & Warnings

  • You should display your web page in several browsers to see how each browser will display your page.

Related Searches:

Resources

Comments

You May Also Like

Related Ads

Featured