CSS specific to a control

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • woodjom
    New Member
    • Mar 2010
    • 1

    CSS specific to a control

    I am in the process of developing some ASP.Net pages and was wondering if i can nest the CSS classes so that i can carry the same CSS class but change the parent classes name so it varies by the parent.

    For example:
    Code:
    .SelDate
    {
    	font-family:Times New Roman;
    	font-size: 12px;
       border: none 0px transparent; 
    }
    .SelDate .headStyle
    {
    	background-color: Black; color: White;
    }
    .SelDate .rowStyle
    {
    	background-color: #666666; color: Black;
    }
    .SelDate .altStyle
    {
    	background-color:#999999; color: Black;
    }
    .SelDate .overStyle
    {
    	background-color:red; color:Black; 
    }
    .SelDate .pagerStyle
    {
    	background-color:Silver; color:Black;
    }
    now lets say i want to create another parent class named ".Product" but want this parent class to have the same subclass names but different CSS style values.

    Will that work? I dont want the Product class subclasses to conflict with the SelDate subclasses.

    Also, i am manually adding the CSSStyle class name to the control, currently, and then assigning the subclass style during code creation.
  • drhowarddrfine
    Recognized Expert Expert
    • Sep 2006
    • 7434

    #2
    iow, you want to do something like:
    Code:
    .SelDate .style { color:red }
    .Product .style { color:blue }
    Yes, you can do that. It's valid and works.

    Comment

    Working...