Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Change pointer for checkbox html

I am new to html and css. Currently I have a checkbox:

<input type="checkbox" name="vehicle" value="Bike">I have a bike<br>

When I hover over the checkbox, I need a hand icon.

How can I achieve this?

like image 704
Sulu.MeanStack Avatar asked Jan 12 '17 13:01

Sulu.MeanStack


2 Answers

Using cursor:pointer you can achieve this

input[type="checkbox"] {
    cursor: pointer;
}
<input type="checkbox" name="vehicle" value="Bike">I have a bike<br>
like image 193
Mukesh Ram Avatar answered Oct 29 '22 20:10

Mukesh Ram


You use the pointer CSS style to change the default cursor to a pointer hand.

First, add an ID or class to your checkbox.

<input id="chkBike" type="checkbox" name="vehicle" value="Bike">I have a bike<br>

And in your CSS, use the following style.

#chkBike{
  cursor: pointer;
}
like image 26
TheValyreanGroup Avatar answered Oct 29 '22 19:10

TheValyreanGroup