简体   繁体   English

单击按钮更改样式表

[英]Changing style sheet on a button click

I want change the theme of my webpage, I need to do it for an asp.net page. 我想改变我的网页主题,我需要为asp.net页面做。 what is the best way to change the looks of a web page. 改变网页外观的最佳方法是什么? Just like that of changing the theme. 就像改变主题一样。 Please suggest the method and explain it 请建议方法并解释它

Asp.net Skins是改变网站布局和风格的好方法。

You will need to use multiple ASP.NET themes that contain specific implementations of css/skins. 您将需要使用包含css / skins的特定实现的多个ASP.NET主题。 In order to change the theme property of your page you may do so in Page_PreInit event. 要更改页面的主题属性,您可以在Page_PreInit事件中执行此操作。 Just assign the Page.Theme property at runtime with the required theme name. 只需在运行时为Page.Theme属性指定所需的主题名称即可。

<link href="style.css" rel="stylesheet" type="text/css" id="mycss" />

$(document).ready(function() 
{
   $('#mycss[rel=stylesheet]').attr('href', 'style2.css');
});

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM