SiteExperts.com Logo Home | Community | Developer's Paradise
User Groups | Site Tools | Site Information | Search
 Main Menu
 Forums
SiteExperts.com Forums
All Discussions

SiteExperts Feedback
The Lounge
Dynamic HTML
Site Design/ Critiques
HTML and CSS
XML Technologies
The Wireless Internet
Internet Explorer
Microsoft .NET
The Server
Technical Support

Sponsored Links

User Groups : Forums : SiteExperts : Dynamic HTML :

Previous DiscussionNext Discussion
 change the color of a checkbox

 

Does anyone know how to change the color of a checkbox?   Background color
changes a square around the checkbox, but the checkbox remains white.  I'm
working with IE 5.5 & IE 6.0.

Started By IsSergeyB on Feb 3, 2004 at 8:59:32 AM

19 Response(s) | Reply

View All Replies | Goto Page: 3 2 1
frumbert on Feb 9, 2004 at 1:34:04 PM

padding needs work, eh? Not a problem - use overflow and clipping !! :o)

<script>
function changecolor(obj){
if (obj.checked) obj.parentNode.style.backgroundColor='green'
else obj.parentNode.style.backgroundColor='red'}
</script>

<form>
<div style="width:14px;height:14px;clip:rect(0 14 14 0);overflow:hidden;">
<span style="background-color: red;position:relative;top:-3px;left:-3px;">
<input onclick="changecolor(this)" type="checkbox" style="margin:0; padding:0; FILTER: progid:DXImageTransform.Microsoft.Alpha(style=0,opacity=50); -moz-opacity:0.5">
</span></div>
</form>


View All Replies | Goto Page: 3 2 1

To respond to a discussion, you must first logon.

If you are not registered, please register yourself to become a member of the SiteExperts.community.

User Name
Password
Copyright 1997-2000 InsideDHTML.com, LLC. All rights reserved.