如何将多个样式表合并为一个 [英] How to combine multiple stylesheets into one

查看:117
本文介绍了如何将多个样式表合并为一个的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

Does anyone know on how to combine multiple stylesheets into one? For example I have

<link rel="stylesheet" type="text/css" href="abc.css" />
<link rel="stylesheet" type="text/css" href="efg.css" />
<link rel="stylesheet" type="text/css" href="hij.css" />
in mysite.html. How can I combine the above 3 stylesheets into one?

thank you.





我的尝试:



如何将多个样式表组合成一个



What I have tried:

how to combine multiple stylesheets into one

推荐答案

使用记事本将三个css文件的内容粘贴到一个css文件。
Use notepad to paste the contents of the three css files into a single css file.


按照它们出现的顺序将3个css文件的内容粘贴到一个文本文件中并称之为'three_in_one.css',然后将其链接到您的html文件
Paste the contents of the 3 css files in the order that they appear into one text file and call it say 'three_in_one.css", then link it to your html file
<link rel="stylesheet" type="text/css" href="three_in_one.css">


基于彼得解决方案的评论

based on the comment from Peter's solution
引用:

请分享演示





第1步: 创建/打开一个新的记事本文件

第2步: 在记事本中打开 abc.css 文件(右单击 - >用记事本打开),复制内容并将其粘贴到新的记事本文件中(s tep 1)

第3步: 在记事本中打开 efg.css 文件(右键单击 - >用记事本打开),复制内容并将其粘贴在新记事本文件中的 end (步骤1)

步骤4: 在记事本中打开 hij.css 文件(右键单击 - >用记事本打开),复制内容并将其粘贴到在新的记事本文件中(步骤1)

步骤5: 现在将新文件保存为 AllFile.css 并复制文件并将其放在项目根文件夹中

第6步: 现在删除3个文件 abc.css,def.css,ghi.css

第7步: 现在添加以下参考



Step 1: Create/open a new Notepad file
Step 2: open the abc.css file in a notepad (right click -> open with notepad ), copy the content and paste it in the new notepad file ( step 1 )
Step 3: open the efg.css file in a notepad (right click -> open with notepad ), copy the content and paste it at the end in the new notepad file ( step 1 )
Step 4: open the hij.css file in a notepad (right click -> open with notepad ), copy the content and paste it at the end in the new notepad file ( step 1 )
Step 5: Now save the new file as AllFile.css and copy the file and place it in your project root folder
Step 6: Now delete the 3 files abc.css, def.css, ghi.css
Step 7: now add the below reference

<link rel="stylesheet" type="text/css" href="AllFile.css" />


这篇关于如何将多个样式表合并为一个的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆