Best Practices: CSS or Themes in ASP.NET?

后端 未结 7 903
迷失自我
迷失自我 2021-02-13 07:03

When should I use ASP.NET Themes, and when should I use CSS? What are the advantages or disadvantages of using one over the other?

7条回答
  •  一个人的身影
    2021-02-13 07:23

    Well i would recommend using both together, i use the theme to set the css classes on controls and then style them in the css files. Example:

    Skin:

    
    
    
    
    
    
    

    Css:

    .Validator
    {
        color: Red;   
    }
    
    .ValidationSummary
    {
        font-size: 0.8em;
    }
    
    .ValidationSummary > ul
    {
        list-style-type: disc;
        padding: 0 0 0 15px; 
        margin: 0;
    }
    
    .ValidationSummary > ul > li
    {
        padding: 0;
        margin: 0;
        color: Red;
    }
    

提交回复
热议问题