VS.NET(C#)--2.8_CCS样式

CSS样式

文件命名

    StyleSheet.css 

      body

  {

    font-size:12px

  } 

    .button

     {

    color:Red;

    text-decoration:none;

    font-size:14px; 

   }

加入页面文件的源视图,在<head>元素内添加<style>元素,如下:

<head runat="server">

  < title >默认模板代码< /title >

  <style type="text/css" >@importurl (stylesheet);</style>

</head>

CSS类引用

在服务器控件上引用CSS类,如下:

<asp:Button ID="btnBookName" runat="server"Text="BookName" OnClick="btnBookName_Click" CssClass="button"/>

设计视图

CssClass属性用于向控件设置或返回CSS样式类。

原文地址:https://www.cnblogs.com/ximi07/p/10883367.html