English 中文(简体)
标题和属性
原标题:Combine and minimize css with title and rel attributes

我一直在阅读有关压缩和尽量减少的剪辑。 具体而言,Concatenate and minification Javacast on the OR atbuilding时 - ASP。 NET MVC 开始开发一个微型信贷银行。 NET 申请和使用Cmbres,以尽量减少和压缩文档。 我感到不快,现在就象斯科特在所述职位上所建议的那样,对MVC式Manager进行评估。

然而,我对档案存在问题: 在我的网站上,允许用户改变网页的风格,即完成界定不同风格的任务。

改变用户点击纽子时的风格,即利用链接标的“标题”特性进行适当的风格:

$( link[rel*=style][title] ).each(function(i) {
   this.disabled = true;
   if (this.getAttribute( title ) == styleName) this.disabled = false;
});

在我一页的头段,我是:

<link rel="stylesheet" type="text/css" href="/Content/css/green.css" title="Green" media="screen" />    
<link rel="alternate stylesheet" type="text/css" href="/Content/css/cyan.css" title="Cyan" media="screen" />
<link rel="alternate stylesheet" type="text/css" href="/Content/css/orange.css" title="Orange" media="screen" />
<link rel="alternate stylesheet" type="text/css" href="/Content/css/navy.css" title="Navy" media="screen" />
<link rel="alternate stylesheet" type="text/css" href="/Content/css/purple.css" title="Purple" media="screen" />
<link rel="alternate stylesheet" type="text/css" href="/Content/css/pink.css" title="Pink" media="screen" />
<link rel="alternate stylesheet" type="text/css" href="/Content/css/wine.css" title="Wine" media="screen" />

问题是,如果把风格单单结合起来,就不能依靠所有权和服装来做转换。 任何帮助或建议都会得到赞赏!

预先感谢!

最佳回答

确实,你应当按要求装载特别安全局的档案。

因此,如果用户选择ink子,那么将插入“pink.css”<link>作为<head>的最后一项内容。

问题回答

暂无回答




相关问题
WebForms and ASP.NET MVC co-existence

I am trying to make a WebForms project and ASP.NET MVC per this question. One of the things I ve done to make that happen is that I added a namespaces node to the WebForms web.config: <pages ...

Post back complex object from client side

I m using ASP.NET MVC and Entity Framework. I m going to pass a complex entity to the client side and allow the user to modify it, and post it back to the controller. But I don t know how to do that ...

Create an incremental placeholder in NHaml

What I want to reach is a way to add a script and style placeholder in my master. They will include my initial site.css and jquery.js files. Each haml page or partial can then add their own required ...

asp.net mvc automapper parsing

let s say we have something like this public class Person { public string Name {get; set;} public Country Country {get; set;} } public class PersonViewModel { public Person Person {get; ...

structureMap mocks stub help

I have an BLL that does validation on user input then inserts a parent(PorEO) and then inserts children(PorBoxEO). So there are two calls to the same InsertJCDC. One like this=>InsertJCDC(fakePor)...

ASP.NET MVC: How should it work with subversion?

So, I have an asp.net mvc app that is being worked on by multiple developers in differing capacities. This is our first time working on a mvc app and my first time working with .NET. Our app does not ...

System.Web.Mvc.Controller Initialize

i have the following base controller... public class BaseController : Controller { protected override void Initialize(System.Web.Routing.RequestContext requestContext) { if (...

热门标签