PDF download Download Article PDF download Download Article

When coding a website in HTML/CSS, a fun trick to learn is to add effects when you hover over an item. The first method will teach you how to hover over text to change the CSS. There are many different tricks with the hover selector; the second method will demonstrate how to make an image appear when you hover over text.

Method 1
Method 1 of 2:

Changing the Page Appearance

PDF download Download Article
  1. 1
    Open your HTML editor. Any code editor will work.
  2. 2
    Advertisement
  3. 3
    Give your item a class. A class is an attribute that lets one style HTML code easily.
     <h1 class="testColor">Hello!</h1>
    
  4. 4
    Link your style to your HTML. There are two ways to do this:
  5. 5
  6. 6
    Save and test your code. If working properly, the page will change when you hover over the text.
  7. Advertisement
Method 2
Method 2 of 2:

Making Something Appear

PDF download Download Article
  1. 1
    Write a line of code that you want the hover to be connected to. Use whatever type of tag you want.
  2. 2
  3. 3
    Put the items you want to appear in the div tag. You might choose to copy an image URL or add your own images.
  4. 4
  5. 5
  6. 6
    Go to a browser and test your code. If working properly, the items will appear when you hover your cursor over the header.
  7. Advertisement


Expert Q&A

Ask a Question
200 characters left
Include your email address to get a message when this question is answered.
Submit
Advertisement

Tips

Submit a Tip
All tip submissions are carefully reviewed before being published
Name
Please provide your name and last initial
Thanks for submitting a tip for review!

You Might Also Like

Change Text Color in HTML Change Text Color in HTML and CSS
Create a Dropdown Menu in HTML and CSSCreate a Dropdown Menu in HTML and CSS
Change the Button Color in HTMLChange the Button Color in HTML
Create a Simple CSS Stylesheet Using NotepadCreate a Simple CSS Stylesheet Using Notepad
Learn Web DesignLearn Web Design
Create a Simple Web Page with HTML Create a Basic HTML Website: A Step-by-Step Guide
Make a JavaScript Image RolloverMake a JavaScript Image Rollover
Create Redirects in HTMLCreate Redirects in HTML
Add a Hyperlink with HTMLCode a Hyperlink with HTML: A Beginner's How-To Guide
Hide a Link in HTML Hide a Link in HTML with Font Color or CSS
Use Font Color Tags in HTML Change the Color of Your Text Using HTML & CSS
Make Text Blink in HTML Make Text Blink in HTML: Easy Tutorial
Link to a Specific Part of a Page Make a Link to a Specific Part of a Webpage in HTML
Insert a Line in HTML Create a Horizontal Line in HTML
Advertisement

About This Article

wikiHow is a “wiki,” similar to Wikipedia, which means that many of our articles are co-written by multiple authors. To create this article, volunteer authors worked to edit and improve it over time.
How helpful is this?
Co-authors: 5
Updated: November 26, 2025
Views: 407
Categories: CSS
Thanks to all authors for creating a page that has been read 407 times.

Is this article up to date?

Advertisement