0

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>
1
  • not understand your problem.Are you asking you want to apply css on just one control RadioButtonList ? Commented Apr 5, 2014 at 12:54

2 Answers 2

1

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

Sign up to request clarification or add additional context in comments.

Comments

0

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>

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.