css美化和冷凝器

时间:2014-04-16 14:20:19

标签: css css3

嘿,我有一个问题,这是两部分,但第一部分显然是我必须开始的地方:

我继承了一个包含三个样式表的项目:desktop.css,tablet.css和mobile.css - 它们在页面上被调用如下:

<link rel="stylesheet" type="text/css" href="/css/tablet.css" media="all and (min-width:600px) and (max-width:799px)" /> 
<link rel="stylesheet" type="text/css" href="/css/mobile.css" media="all and (min-width:10px) and (max-width:599px)" /> 
<link rel="stylesheet" type="text/css" href="/css/desktop.css" media="all and (min-width:800px) " /> 

然而,在我之前的程序员很匆忙,而且大多数代码都是一样的;他们只是根据需要对每个文件进行了调整。可能90%的代码是相同的。

我的目标是首先使用一个通用样式表,如下所示:

<link rel="stylesheet" type="text/css" href="/css/UNIVERSAL.css" /> 
<link rel="stylesheet" type="text/css" href="/css/tablet.css" media="all and (min-width:600px) and (max-width:799px)" /> 
<link rel="stylesheet" type="text/css" href="/css/mobile.css" media="all and (min-width:10px) and (max-width:599px)" /> 
<link rel="stylesheet" type="text/css" href="/css/desktop.css" media="all and (min-width:800px) " /> 

并将所有常见的css导入universal.css,并在其他文件中仅包含&#34;覆盖&#34;该特定设备需要。

这三个文件都很乱。有多个类/ id声明实例。他们完全失灵了。我知道那里有CSS预处理器,但有没有任何应用程序需要一个CSS文件,&#34; READ&#34;它,并以浓缩格式重新输出?

在css上做差异并看看有什么不同也是很好的。 DIFF本身不会起作用,因为可能有多种方式出现故障。所以如果你对这方面有任何了解,我会很感激。

1 个答案:

答案 0 :(得分:1)

检查proCSSor

的高级选项