How to Create an Image Rollover Using HTML Programming

How to Create an Image Rollover Using HTML Programming thumbnail
Learning HTML can help you customize your Web page.

Hypertext markup language (HTML) is a computer language that is used to create Web pages. Knowing how to use HTML codes can help you manipulate your page settings. You can create an image link that will change when visitors move the mouse over the link. Image rollovers can be created using JavaScript. You can also create image rollovers for items in menus. When visitors scroll their mouse over the menu items, the menu item will become highlighted. Creating image rollovers is a good way to give your pages a more professional appeal.

Instructions

    • 1

      Start the word processor or text editor that you will use to create your Web page and open the page. Add the desired image and include it inside of the <CENTER> tag. After the image name, type NAME=“rollover”.

    • 2

      Type <A HREF=“?”> before the <CENTER> tag. Replace the question mark with the address of the Web page that you wish to have appear when a visitor clicks on the image. Type </A> after the image.

    • 3

      Verify that your text looks like the following:
      <A HREF=“pages.html”>
      <CENTER><IMG SRC=“photo.jpg” NAME=“rollover”></CENTER>
      </A>

    • 4

      Type ONMOUSEOVER=‘rollover.src=“?” ’ inside of the <A> tag. Replace the question mark with the location of the image that you wish to have appear when a visitor moves the mouse over the original image.

    • 5

      Type ONMOUSEOUT=‘rollover.src=“?” ’ Replace the question mark with location of the image that was added in Step 1.

    • 6

      Verify that your text looks similar to the following:
      <A HREF=“pages.html” ONMOUSEOVER=‘rollover.src=“photo.jpg” ’
      ONMOUSEOUT=‘rollover.src=“photo.jpg” ’>
      <CENTER><IMG SRC=“photo.jpg” NAME=“rollover”></CENTER>
      </A>

    • 7

      Open a new Web browser to verify that your Web page displays the image that you are using for your image rollover. Test your site and verify that visitors can move the mouse over the image and it will change to the image that you specified.

Tips & Warnings

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

Related Searches:

Resources

  • Photo Credit Comstock/Comstock/Getty Images

Comments

View all 7 Comments

You May Also Like

  • How to Show Text on Rollover HTML

    Showing text on rollover is a simple matter of editing the title and alt attributes in HTML. Showing additional information on rollover...

  • HTML Image Rollover Effects

    HTML Image Rollover Effects. Image rollover is an effect created on Web pages to make navigation easier for the end user. For...

  • How to Make an Image Rollover

    A rollover image is an image on a Web site that changes in appearance when a user rolls his mouse over it...

  • How to Create a Rollover Image

    If you're designing a web page, and you want to create an image that changes to a different image when your mouse...

  • Rollover Image Effects

    Rollover Image Effects. Rollover image effects are often employed on web pages to add flashy presentation. A rollover image effect is an...

  • HTML Code for OnMouseOver on Buttons

    Web pages use JavaScript functions to enhance interactivity with elements such as forms. Forms in HTML pages can contain multiple user input...

  • HTML Rollover Tutorial

    Rollover images can add a dynamic effect to just about any website. The purpose of a rollover is to display separate images...

  • Rollover Effects in HTML

    Rollover Effects in HTML. In 1993, Marc Andreessen and Eric Bina introduced Mosaic, the first Internet browser capable of displaying text and...

  • How to Change an Image on a Mouse Over in HTML

    Website buttons containing images that change on mouseover provide your visitors with a more dynamic experience. They also send a subtle instruction...

  • How Do You Create a Rollover in HTML Text?

    A rollover, or pop-up, is an effect that you can apply to your HyperText Markup Language (HTML) text to distinguish the content...

  • How to Make an Image Rotate on Mouseover

    The "onMouseOver" function (also called "hover") is a JavaScript event that triggers an action in the user interface when the mouse cursor...

  • How to Do Rollover Images

    A rollover image is an effect where the image changes when you move your mouse over it. For example, if you move...

  • How to Show Text on Rollover

    Showing text when a visitor rolls over a link or image on your website is a great way to share additional information...

  • What Are the Risks of a Roll Over Motor?

    What Are the Risks of a Roll Over Motor?. Drivers today are increasingly concerned with the safety of large- and small-motor vehicles,...

  • How to Make a Link Display Rollover Text

    To make a link produce a text message when you roll your mouse over it, you first need to know the format...

  • How to Create a Mouse-Over Effect With Dreamweaver

    A "mouse-over" effect occurs when a user moves the mouse pointer onto an image. When the pointer rests on the image, it...

  • CSS Image Rollover Effect

    Image rollovers are useful tools in helping your end-users track their mouse across your Web page. A website designer will often pack...

Related Ads

Featured