add general_formatting_rules.rst

This commit is contained in:
red-flower 2013-05-27 15:23:08 +08:00
parent e62901f722
commit 229c14a4a0

View File

@ -0,0 +1,60 @@
总体排版规则
==============
缩进
---------
每次缩进使用两个空格。
不使用TAB键或者混合使用TAB键和空格进行缩进。
.. code-block:: html
<ul>
<li>Fantastic
<li>Great
</ul>
.. code-block:: css
.example {
color: blue;
}
大小写
----------
只使用小写字母。
所有的代码都使用小写字母适用于HTML元素、属性、属性值除了text/CDATA、CSS选择器、属性名以及属性值字符串除外
.. code-block:: html
<!—不推荐 -->
<A HREF="/">Home</A>
<!—推荐 -->
<img src="google.png" alt="Google">
.. code-block:: css
/* 不推荐 */
color: #E5E5E5;
/* 推荐 */
color: #e5e5e5;
尾部的空格
------------
删除尾部的空格。
尾部的空格是多余的,不删除则形成无意义的文件差异。
.. code-block:: html
<!— 不推荐 -->
<p>What?_
<!— 推荐 -->
<p>Yes please.