Reputation: 3661
I have a CSS file I want to use for my page, except for a certain control, in my case a RadioButtonList, How can this be done?
<asp:RadioButtonList ID="RadioButtonList1" runat="server"></asp:RadioButtonList>
Upvotes: 0
Views: 310
Reputation: 4185
Add css file to header
<head>
<link rel="stylesheet" type="text/css" href="mystyle.css">
</head>
Add style class name
<asp:RadioButtonList ID="RadioButtonList1" class='buttonStyles' runat="server"></asp:RadioButtonList>
In your CSS file, style the element
.buttonStyles {
padding: 5px;
}
If you want to call ID to implement style, add this to your asp control: ClientIDMode='static'
<asp:RadioButtonList ID="RadioButtonList1" class='buttonStyles' runat="server" ClientIDMode="static"></asp:RadioButtonList>
Upvotes: 0
Reputation: 8920
You cannot exclude an item from CSS, but you can set the style you want to apply to Radiobuttonlist explictly by the ID so it looks it is not affected by the overal css..
CSS3 has :not() but I think this is not what you are looking for. http://www.w3.org/TR/css3-selectors/#negation
Upvotes: 1