Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 4382742
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 21, 20262026-05-21T12:49:01+00:00 2026-05-21T12:49:01+00:00

So, I have a DIV full of four HTML buttons that use an image

  • 0

So, I have a DIV full of four HTML buttons that use an image instead of any text. Using CSS, I style it so that the img is the same width as its parent button. On three of the four buttons, they will always carry the cursor: pointer attribute because they will always be clickable. The fourth button, however, will occasionally be in a state in which it is disabled, so I have to toggle the CSS between cursor: pointer and cursor: default.

As my code stands, this works properly in Chrome and IE 7/8/9 (6 is not in my supported audience), however Firefox does not change cursor from default for any of them, regardless of if one of the buttons are disabled. Note that while this does work when I apply the cursor attribute to the parent BUTTON element, I’d prefer to use CSS to have the cursor change rather than use any client-side Javascript. Since this works in two of the three modern browsers I’m testing (including IE7, mind you!), I thought it should be possible in FF too.

Here’s the HTML markup that I have:

<button id="btn1" class="my-button"><img src="/path/to/my-img1.gif" alt="Img1" /></button>
<button id="btn2" class="my-button"><img src="/path/to/my-img2.gif" alt="Img2" /></button>
<button id="btn3" class="my-button"><img src="/path/to/my-img3.gif" alt="Img3" /></button>
<button id="btn4" class="my-button"><img src="/path/to/my-img4.gif" alt="Img4" /></button>

And here are the CSS classes that I have designated for this markup, as well:

<style>
    .my-button {
    display: block;
    float: left;
    margin: 0px;
    padding: 0px;
    vertical-align: top;
    border: none;
    background: none;
    }

    .my-button img {
    cursor: pointer;
    }

    .my-button img .disabled {
    cursor: default;
    }
</style>

And for anyone with any of that pesky curiosity, all of the click events and action is handled with jQuery depending on whatever business logic I need to go with it and the surrounding page.

If there’s more information that I can furnish, please let me know. I feel like I came across a Firefox stumbling block here.

Edit: For reference, I’m using Firefox 4.0 with Firebug installed. Same behavior whether I have a Firebug on for that tab or not. Chrome is up-to-date, currently at version 10.0.648.204.

Edit 2: As I’ve denoted in the comments below, I still have not figured out a solution to this issue, but have settled on using @wdm’s answer as a temporary solution – this way Firefox gets cursor: pointer set for all buttons regardless of state, and Chrome and IE will obey the CSS I put forth for the embedded img in each button tag. If I find out what’s going on in my code or if someone else finds a proper solution for Firefox, I’ll move the answer there. Thanks again for the suggestions!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-21T12:49:02+00:00Added an answer on May 21, 2026 at 12:49 pm

    Have you tried?

    .my-button {
        cursor: pointer;
    }
    

    EDIT: You could also make a separate class with “cursor:pointer” and use jQuery’s .addClass() .removeClass() depending on the state. Or have jQuery directly alter the css with

    .css("cursor", "pointer");
    

    EDIT: One more idea…

    button {
        cursor: pointer;
    }
    button:disabled {
        cursor: default;
    }
    

    Seems to be working for me in all major browsers.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

in my html page I have div with css: padding: 0px; color: rgb(51, 51,
I have a div full of text, photos, etc. It is generated dynamically, and
I have the following code <!DOCTYPE HTML> <html> <head> </head> <body> <div class=full-details-box name=full_details_box
I have a div that holds a bunch of thumbnail images. Each image has
I have code that gets a div contents: include_once('simple_html_dom.php'); $html = file_get_html(link); $ret =
I have a div that I want to go full-screen (100% width/height of Window
I have a div that I want to go full-screen (100% width/height of Window
I want have width and height of a full div with scroll using JQuery,
I have four or five thumbnails next to a full-size image. When I click
I have a 'link' that, when clicked, will show a div full of content.

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.