doyoe / html-css-guide Goto Github PK
View Code? Open in Web Editor NEWHTML/CSS开发规范指南
License: Apache License 2.0
HTML/CSS开发规范指南
License: Apache License 2.0
类似下面这种顺序
.element { ... }
.element-avatar { ... }
.element-selected { ... }
@media (min-width: 480px) {
.element { ...}
.element-avatar { ... }
.element-selected { ... }
}
关乎此规范的第四点:到底是 2 个空格替代 1 个 Tab,还是 4 个空格替代 1 个 Tab。这个问题争论起来估计又是跟使用哪个编辑器一样的圣战了。(PS. 自身则是根据其他 的规范使用了 2 个空格替代 1 个 Tab。)
关乎次规范第六点:强制自闭合标签一定要用 / 闭合,应该是 XHTML 中规定的吧?到 HTML5 自闭合标签中的 / 应该是可选的,所以最好就是这些标签不进行自闭合咯。
关乎此规范第十点:现在应该是越来越多的站点支持 https 了,这里说将 http、https 协议头省缺。但是感觉支持 https 就使用 https,不支持则使用 http,以及其他的协议头又不省缺,这样操作可能更好。还节省了协议查询吧?
此规范未见提及,但属性值应该都用双引号引起,这括号里边的地址应该属于 url() 的属性值吧,所以我感觉要用双引号引起。
此规范未见提及。之前在 LCTT 翻译工作中,其实都是中文与英文或者数字与中文之间加一个空格。
其实,不管写法如何,最终目的都是为更好在一个团队代码书写中保持代码风格一致。最后实现,不管团队中有多少人在写代码,最后的产品代码看起来就是一个人在写的那种效果。
来到这里提意见,主要是之前看了 Code Guide by @mdo, 中文版,看到和你发起的规范有一些出入,所以在此提出来。
希望这些东西对你我都有用处。
文档目录结构 部分约定了目录结构, 但是开发当中遇到最多的是找和当前html页面非通用部分有关的js css
对于sublime来说 可以按Ctrl+P输入一个名称就能快速定位文件, 如果对文件名有个约定将会对阅读和调试代码帮助很大
|-- html 静态页面模板目录
|-- bgimg 背景图目录(假设有的话) //imagesBg
|-- image 前景图目录(假设有的话) //images
|-- font 字体目录(假设有的话)
|-- scripts 脚本目录
|-- styles(Yo) 样式目录
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.