Home > ASP.net C#, tricks > Using CSS to Style a RadioButtonList Control in ASP.NET

Using CSS to Style a RadioButtonList Control in ASP.NET

Hi,
I wanted to give styling to Radio list box.
Also wanted to highlight the radio span after selection.
Sharing the code for your reference:

CSS code:
.radioboxlist radioboxlistStyle
{
font-size:x-large;
padding-right: 20px;
}
.radioboxlist label {
color: #3E3928;
background-color:#E8E5D4;
padding-left: 6px;
padding-right: 16px;
padding-top: 2px;
padding-bottom: 2px;
border: 1px solid #AAAAAA;
white-space: nowrap;
clear: left;
margin-right: 10px;
margin-left: 10px;
}
.radioboxlist label:hover
{
color: #CC3300;
background: #D1CFC2;
}
input:checked + label {
color: #CC3300;
background: #D1CFC2;
}

In asp.net Server code:

<asp:RadioButtonList ID="RadioButtonListGarment" runat="server" CssClass="radioboxlist">

Advertisements
Categories: ASP.net C#, tricks
  1. Tuyet Huynh
    February 23, 2016 at 3:42 am

    Thanks for the code, it works nice.

  2. CheckMate
    November 15, 2016 at 6:30 am

    it works good

  1. No trackbacks yet.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: