css样式表格线合并_将CSS媒体样式合并为一个文件

css样式表格线合并

When a user comments on one of my blog posts, and they provide a website URL, I always visit the site. I appreciate the time a visitor takes to comment on a post, so I return the favor by checking out the user's website...and the source code.

当用户对我的一篇博客文章发表评论并提供网站URL时,我总是会访问该网站。 我很感谢访问者对帖子发表评论所花费的时间,因此我通过查看用户的网站...和源代码来回馈青睐。

Often I see the following:

我经常看到以下内容:


<link href="styles/main.css" rel="stylesheet" type="text/css" media="screen" />
<link href="styles/print.css" rel="stylesheet" type="text/css" media="print" />

The above code requests two separate stylesheets, one for global media styles (screen, print, handheld, tv...) and one for print only. There's nothing wrong with the above, but if load time is an issue you could save yourself a server request by combining your CSS files:

上面的代码要求两个单独的样式表,一个用于全局媒体样式(屏幕,打印,手持式,电视...),一个仅用于打印。 上面没有什么问题,但是如果加载时间有问题,您可以通过组合CSS文件来节省服务器请求:

/*  all media  */
@media all {
	body	{ color:#666; font:13px arial, helvetica, sans-serif; padding:20px 0 30px 0; }
}

@media print {
	body	{ color:#000; font:12px arial, helvetica, sans-serif; padding:0; }
}

You address each media by using "@media [media] { /* css here */ }". I also use a single CSS file to make editing easier -- no switching buffers, and how often do you set specific styles for print and screen per a CSS class?

您可以使用“ @media [media] {/ * css here * /}”来寻址每种媒体。 我还使用一个CSS文件来简化编辑-没有切换缓冲区,并且每个CSS类您多久为打印和屏幕设置特定样式?

翻译自: https://davidwalsh.name/css-media

css样式表格线合并

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值