内嵌样式VS在CSS样式 [英] Inline styles vs styles in CSS

查看:238
本文介绍了内嵌样式VS在CSS样式的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我知道把你所有的样式在CSS文件是做,因为它是一个很大的整洁最好的事情。

I know placing all your styles in a CSS file is the best thing to do as it is a lot neater.

但做它的真的不管款式都是内联或在CSS ?????

But does it REALLY matter if the styles are inline or in a CSS?????

以下修改

我的计划是只放在我的母版的样式和所有其他网页将使用母版....我认为正确的说法是不是内联,但嵌入式???

My plan is to just place the styles in my MasterPage and all other pages will use the MasterPage....I believe the correct term is not "INLINE" but Embedded???

推荐答案

使用内联CSS:


  • 重复每一个相同的规则
    在页面元素。

  • 更code和更大的文件大小
    传输到客户端。

  • 难以维持,假设你想
    在宽度变为200像素,你
    将需要经过所有页面
    并且由一个编辑之一。

在线:

<div style="width:100px; height:100px;"></div>
<div style="width:100px; height:100px;"></div>

外部或把CSS类的头部[嵌入式造型]:

external OR put css classes in the head [embedded styling]:

<div class="big"></div>
<div class="big"></div>

根据您的编辑:的接缝处没有内嵌CSS在我上面的例子一样,这是同样的想法与使用外部文件,所以如果你想要做的前进,这是相同。

Based on your edit: that seams not inline css as in my example above, like that it is the same idea as using external file, so if you want to do that go ahead, it is the same.

这篇关于内嵌样式VS在CSS样式的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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