Glossary of web design terms you should know

Create your website in 60 seconds with AI. Start for free!

Generate a website
Back to glossary

Hover state

A hover state refers to the visual change or effect that occurs when a user places their mouse cursor over a clickable element, such as a button or a link. This is not just for looks. It's a helpful cue that tells users, "This is something you can interact with!"

A good hover effect makes a website feel more interactive and dynamic. It also provides instant feedback, so the user knows exactly what they're about to click on.

How hover states work

Behind the scenes, web developers use a language called CSS (Cascading Style Sheets) to create these hover effects. Here's a simplified look at how it usually works.

  1. CSS pseudo-class. The :hover selector is used in CSS to create hover effects.
  2. Defining the change. When :hover is triggered, CSS tells the browser to apply a specific set of visual styles to that element.
  3. What kind of changes? These styles can change almost anything visual – the color, size, add a shadow, make it fade in or out, and lots more.
  4. Touchscreen consideration. It's worth noting that on phones and tablets (touch devices), there isn't a "hover" in the same way. Usually, the hover effect might appear briefly when you tap and hold an element, or developers might use other touch-based interactions instead.

Examples of hover state

You've probably encountered these all over the web.

  • Button color change. This is common. A button might go from a light green to a darker green when you hover over it, clearly indicating it's clickable.
    Example: For instance, a button that says "Submit" might turn a slightly darker shade of its original color when you mouse over it.
  • Underlining links. This is the old-fashioned way of showing that text is a link. Very often, a link will be unadorned until you hover, at which point an underline will appear. Occasionally the color will change too.

Example: Look at the links in a block of text; they get an underline when you hover.

  • Image hover effects. Hovering over an image might make it zoom a little, fade, or even show a caption. This can be used to make image galleries or lists of products more interactive.
    Example: Imagine a photo gallery. When you hover over a photo, it might grow a little larger.

How to Implement Hover States

Here are the basic steps to implement hover states using CSS.

  1. Choose the element. Identify the element you want to apply the hover effect to (e.g., a button, link, or image).
  2. Write the CSS. Use the :hover pseudo-class to define the visual effect when the element is hovered over.
  3. Test your design. Ensure the hover state feels responsive, intuitive, and visually appealing across various devices and screen sizes.

Best practices for hover states

  1. Subtle effects. Overly flashy or distracting hover effects can be annoying. A gentle change is usually more effective.
  2. Consistency. Use similar hover styles for similar types of interactive elements across your website. This helps users learn what to expect.
  3. Mobile considerations. Since there's no true "hover" on touchscreens, make sure your website is still easy to use without relying solely on hover effects for important interactions. Consider alternative visual cues for touch.
  4. Accessibility. Ensure your hover effects provide enough visual contrast for everyone, including those with visual impairments. For example, if you're changing a background color, make sure the text color still has enough contrast. 

FAQs about hover states

Why are hover states important for web design?

Hover states give users immediate feedback, making it clear which elements they can click or interact with. This makes the website more intuitive and user-friendly.

Can I use hover effects on mobile devices?

Not in the same way as with a mouse. While some touch interactions might briefly trigger a hover-like state, it's generally not a reliable interaction on mobile. Designers often use other visual cues or touch-specific interactions instead.

What are the most common hover state effects?

Color changes, underlines on links, slight scaling or movement of elements, and subtle background transitions are very common.

How can I make my hover states accessible?

Use sufficient color contrast, and don't rely solely on color changes. Consider adding other visual cues like underlines or borders. Importantly, the :focus state should provide a clear visual indicator for keyboard navigation.

Build a modern, engaging website effortlessly

Want a website that looks great and feels intuitive to use? With B12’s AI-powered website builder, you can launch a professional online presence in no time. Create your site today and give your visitors the seamless experience they expect.

Draft your site in 60 seconds

Get an AI website made specifically for you that's free to launch.

Start for free ✨

No credit card required

Draft your website in 60 seconds

In just a few clicks, build a website with all the features you need to thrive online

Get started for free

Product

Customers

Helpful information and tools

© 2025 B12. All rights reserved.
PrivacyTerms of Service