在编写我的第一个样式表时,我应该遵循任何CSS标准吗? [英] Are there any CSS standards that I should follow while writing my first stylesheet?

查看:87
本文介绍了在编写我的第一个样式表时,我应该遵循任何CSS标准吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我目前在我的第一个网站上工作。我不知道从哪里开始在CSS页面,或者如果有任何标准,我应该跟随。

I am currently working on my first website. I have no idea where to start on the CSS page, or if there are any standards that I should be following.

我会喜欢任何链接或第一手建议。

I would appreciate any links or first-hand advise.

推荐答案

初学者经常犯错误:

语义。尝试表达概念,而不是格式。创建示例:

CSS is semantic as well. Try to express concepts, not formats. Contrived example:

div.red
{
    color: red;
}

而不是:

div.error
{
    color: red;
}

CSS应该是您在网站上使用的概念的格式化伴侣,所以他们应该反映在它。你会以这种方式更加灵活。

CSS should be the formatting companion for the concepts you use on your web site, so they should be reflected in it. You will be much more flexible this way.

这篇关于在编写我的第一个样式表时,我应该遵循任何CSS标准吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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