3

When I hover over a checkbox or it's label in Firefox or IE, the checkbox enters an active state where it is highlighted, indicating that a click will affect it. However this doesn't appear to be working chrome for me.

Here's some very, very simple code:

<label>
    <input type="checkbox"/>
    Sample Check Label
</label>

Here's a fiddle to try out

Here's an example of how checkboxes are rendering in all browsers:

screenshots

I'm using chrome 32.0.1700.76 m

  • Is this an issue other people are having with chrome?
  • If other people aren't having this issue, any ideas what could be causing it (extension, add on)
  • Is this actually the way chrome chooses to render checkboxes?
    • If so, are there any workarounds for cross browser consistency?
KyleMit
  • 30,350
  • 66
  • 462
  • 664
  • 3
    *"Is this actually the way chrome chooses to render checkboxes?"* - Yes. – Adrift Jan 17 '14 at 19:01
  • Looks to be default behaviour for me at least. I don't see a problem here - the user can always click on the checkbox itself if unsure, although that still doesn't highlight it – Bojangles Jan 17 '14 at 19:02
  • Unfortunately, Chrome has switched to non-native checkboxes (cf. ["Chrome 32 vs Windows"](http://winsupersite.com/cloud/chrome-32-vs-windows)). The highlight effect is most probably handled by Windows itself and therefore doesn't appear on those non-native checkboxes (unless Chrome also tries to mimic Windows' default behavior) – ComFreek Jan 17 '14 at 19:06
  • 2
    On a related note I'm hating Chrome 32's new scrollbars. – j08691 Jan 17 '14 at 19:25
  • @j08691, there's an [app for that](https://chrome.google.com/webstore/detail/win7-scrollbars/cifcnoebhbpdndjendfkpehpfbglgfkc) – KyleMit Jan 18 '14 at 14:11

2 Answers2

4

Since apparently chrome is doing this intentionally to move away from native controls, here's a way to change the default behavior in chrome.

Add this CSS:

input[type=checkbox]:hover {
    -webkit-box-shadow: inset 0 0 2px 2px rgba(82,168,236,.6);
}

Here's a Demo in Fiddle

Here's an example*:

screenshot

†The webkit prefix will also apply to safari browsers
**There have been prettier things in the world, but I'd still rather have this than nothing*

Community
  • 1
  • 1
KyleMit
  • 30,350
  • 66
  • 462
  • 664
  • You mean "moving away from native controls", not moving away from **non-** native controls"? – Rudie Jan 27 '14 at 23:22
0

Chrome's new rendering has quite a few UI changes.

Just use a simple CSS pseudo-class to fix it.

Fiddle: http://jsfiddle.net/4bpbr/3/

HTML

<label>
    <input type="checkbox"/>
    Sample Check Label
</label>

CSS

input:hover {
    background:#CCC;
}
hichris123
  • 10,145
  • 15
  • 56
  • 70
Nicholas Hazel
  • 3,758
  • 1
  • 22
  • 34