Chris
Chris

Reputation: 2303

Disable CSS for specific control only in asp.net

I have custom CSS for checkbox control into my web form, which is linked on the Master page hence reflect to all child page.

Now, In my gridview I have checkboxes and I don't want to keep the same checkbox sytle. How to disable CSS for checkboxes inside gridview?

Upvotes: 0

Views: 1592

Answers (1)

Kevin Adolfsson
Kevin Adolfsson

Reputation: 64

The simpliest way to change the CSS the checkboxes in your GridView is to:

  1. Add a CSS-class to your gridview (example: gridView)
  2. Add this CSS in your stylesheet file:

.gridView input[type=checkbox]{

margin:Xpx Xpx Xpx Xpx;

.. ..your style attributes...)

}

This will only affect the checkboxes that is children to an element that has CSS-class "gridView".

Upvotes: 2

Related Questions