【发布时间】:2010-04-11 17:24:30
【问题描述】:
请参阅本页的/* Common Classes */ 部分。
http://webdesign.about.com/od/css/a/master_stylesht_2.htm
这些 css 类好用,可以在任何项目中使用吗?在语义方面?
/* Common Classes */
.clear { clear: both; }
.floatLeft { float: left; }
.floatRight { float: right; }
.textLeft { text-align: left; }
.textRight { text-align: right; }
.textCenter { text-align: center; }
.textJustify { text-align: justify; }
.blockCenter { display: block; margin-left: auto; margin-right: auto; } /* remember to set width */
.bold { font-weight: bold; }
.italic { font-style: italic; }
.underline { text-decoration: underline; }
.noindent { margin-left: 0; padding-left: 0; }
.nomargin { margin: 0; }
.nopadding { padding: 0; }
.nobullet { list-style: none; list-style-image: none; }
【问题讨论】:
-
这些规则集带有匹配 HTML 类的类选择器,而不是 CSS 类(不存在)。术语“CSS 类”已被应用于“规则集”、“选择器”、“类选择器”和“HTML 类”,使其不精确、混乱和错误。最好避免。
-
@takpar 骆驼与否,这并不重要。重点是这些类的含义,而不是它们的视觉意义。
标签: css semantic-markup