位置: 首頁 > 設計 > 網頁設計

asp.net 動態引用樣式表程式碼示範

2016-08-22 網頁設計

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檔案路徑";

標籤:樣式表 aspnet 程式碼 引用
2016-02-12
2016-07-28
2016-02-12
2016-02-12
2016-10-24
2018-02-04
2015-11-16
2016-07-10
2016-10-24
2016-04-10

Copyright ©2024 才華齋 All Rights Reserved.