Click here to Skip to main content
15,887,974 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi Expert!

I have created custom check-box on HTML, that's working fine on IE 9 , IE 10 and other latest version browser. But when I try to run it on IE 7 and IE 8, it not working. see in image. What i do? Please help me!

Image

http://i.stack.imgur.com/9mFUY.png[^]

CSS

CSS
.ckbox
{
    width: 25px;
    height: 25px;
}
.custom-checkbox
{
    position: relative;
    display: inline-block;
}

.custom-checkbox > .box
{
    position: relative;
    display: block;
    width: 25px;
    height: 25px;
    background-color: #E5E5E5;
    padding: 0px;
    margin: 0px;
}

.custom-checkbox > .box > .tick
{
    position: absolute;
    left: 4px;
    top: 7px;
    width: 14px;
    height: 6px;
    border-bottom: 4px solid #000;
    border-left: 4px solid #000;
    -webkit-transform: rotate(-45deg);
    -moz-transform: rotate(-45deg);
    -o-transform: rotate(-45deg);
    -ms-transform: rotate(-45deg);
    transform: rotate(-45deg);
    display: none;
}

.custom-checkbox > input:checked + .box > .tick
{
    display: block;
}

.custom-checkbox > input
{
    position: absolute;
    outline: none;
    left: 0;
    top: 0;
    padding: 0;
    width: 25px;
    height: 25px;
    border: none;
    margin: 0;
    opacity: 0;
    z-index: 1;
}



HTML

HTML
<table style="background-color: #E5E5E5;">
        <tr>
            <td>
                <span class="custom-checkbox">
                    <input id="fileItem" name="fileItem" type="checkbox" class="ckbox" value="1" checked="checked" />
                    <span class="box"><span class="tick"></span></span>
                </span>
                <input id="fileId" name="fileId" type="hidden" value="" />
            </td>
            <td>
                <label for="fileItem" title="">
                    Check</label>
            </td>
        </tr>
    </table>
Posted
Updated 10-Apr-13 6:17am
v2

I have IE 10. I saw the following page in IE9, 8 and 7 modes and do not see any issues.

index.html:

<style type="text/css">
.ckbox
{
width: 25px;
height: 25px;
}
.custom-checkbox
{
position: relative;
display: inline-block;
}

.custom-checkbox > .box
{
position: relative;
display: block;
width: 25px;
height: 25px;
background-color: #E5E5E5;
padding: 0px;
margin: 0px;
}

.custom-checkbox > .box > .tick
{
position: absolute;
left: 4px;
top: 7px;
width: 14px;
height: 6px;
border-bottom: 4px solid #000;
border-left: 4px solid #000;
-webkit-transform: rotate(-45deg);
-moz-transform: rotate(-45deg);
-o-transform: rotate(-45deg);
-ms-transform: rotate(-45deg);
transform: rotate(-45deg);
display: none;
}

.custom-checkbox > input:checked + .box > .tick
{
display: block;
}

.custom-checkbox > input
{
position: absolute;
outline: none;
left: 0;
top: 0;
padding: 0;
width: 25px;
height: 25px;
border: none;
margin: 0;
opacity: 0;
z-index: 1;
}
</style>
<table style="background-color: #E5E5E5;">
<tr>
<td>
<span class="custom-checkbox">
<input id="fileItem" name="fileItem" type="checkbox" class="ckbox" value="1" checked="checked" />
<span class="box"><span class="tick"></span></span>
</span>
<input id="fileId" name="fileId" type="hidden" value="" />
</td>
<td>
<label for="fileItem" title="">
Check</label>
</td>
</tr>
</table>
 
Share this answer
 
No its not working with IE6,7,8
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900