asp.net 动态引用样式表代码示范
- 网页设计
- 关注:1.08W次
1. 添加CSS样式:
Style style = new Style();
Color = ;
Color = tGray;
teStyleRule(style, null, "body");
2. 链接外部的CSS样式表:
HtmlLink link = new HtmlLink();
("type", "text/css");
("rel", "stylesheet");
("href", "~/");
(link);
方法3 public string m_StyleSrc = y; //公共变量 ,样式文件路径
private void Page_Load(object sender, tArgs e) {
m_StyleSrc = "../"; //页面加载时赋值 }
}
方法4 下面这个方法没试过,不知是否能用
protected void Page_Onload(object sender, EventArgs e) {
eSheetTheme = "../css/";
}
方法5 页面:
后台
= "css文件路径";
- 文章版权属于文章作者所有,转载请注明 https://xuezhezhai.com/sjzz/sjzz/1vm5ve.html