问题描述:

<div style="padding-top:5px; overflow:hidden; font-size:13px;">

<div style="float:left;">

<div style="background-color:blue; width:20px;">

<input type="checkbox" id="rememberme" style="z-index:-1;" />

</div>

</div>

<div style="float:left;">

Remember Me

</div>

<div style="float:right;">

<a href="" id="forgotpassword"> Forgot Password ? </a>

</div>

</div>

I want to hide the checkbox behind the parent DIV.

I tried VISIBILITY:HIDDEN; for the checkbox, but I wanted to make a jQuery function where I click on this checkbox and something should happen, but it didnt happen when it was hidden, when I showed it back again, it worked, so I don't wanna use HIDDEN, but i wanna put it behind the div, so it doesn't show up.

this code isn't working, I used z-index=-1, and later z-index:20 for the parent DIV, it didn't work :(

网友答案:

You shouldn't need to hide the checkbox behind your div.

Try using display:none; on the element:

#rememberme {
    display: none;
}
网友答案:

Yes Ali, Now you can customized checkbox, here is example http://jsfiddle.net/chanduzalte/7rSug/3/

相关阅读:
Top