Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Change Style/Look of Asp:CheckBox using CSS

I want to change the standard "3D" look of the standard asp.net checkbox to say solid 1px. If I try to apply the styling to the Border for example it does just that - draws the standard checkbox with a border around it - which is valid I guess.

Anyway, is there a way to change how the actual textbox is styled?

like image 472
JamesSugrue Avatar asked Sep 22 '08 02:09

JamesSugrue


People also ask

How do you change the shape of a check box?

To change size, color, or border style of the check box, select the Use a style to format text typed into the empty control box, and then click New Style. Under Formatting, select a font size for the check box. In the Color list, select a color. To select a different border, select Format > Border.

How do I color a checkbox in CSS?

“:hover” is used to style the checkbox when user hovers over it. Notice that when the mouse pointer move over the checkbox the color of it changes to yellow. “:active” is used to style the checkbox when it is active. Notice that when click the checkbox it will first notice a red color and then the green color.

How can I change checkbox color checked?

How to change color check in checkbox? Best option would be to inspect the element in chrome and then try your CSS there itself. Fastest way to achieve these type of CSS changes. Best option would be to inspect the element in chrome and then try your CSS there itself.


1 Answers

paste this code in your css and it will let you customize your checkbox style. however, it's not the best solution, it's pretty much displaying your style on top of the existing checkbox/radiobutton.

   input[type='checkbox']:after 
{

        width: 9px;
        height: 9px;
        border-radius: 9px;
        top: -2px;
        left: -1px;
        position: relative;
        background-color: #3B8054;
        content: '';
        display: inline-block;
        visibility: visible;
        border: 3px solid #3B8054;
        transition: 0.5s ease;
        cursor: pointer;

}

input[type='checkbox']:checked:after 
    {
        background-color: #9DFF00;
    }
like image 129
dizad87 Avatar answered Oct 20 '22 15:10

dizad87