处置惩罚了 class 值中囊括一个词的环境。在 HTML 中,一个 class 值中能够席卷一个词列表,各个词之间用空格兼并。譬喻,如果盼望将一个特定的元素同时符号为重要(important)和告诫(warning),即可以写作:
<p class="important warning"> This paragraph is a very important warning. </p>
这两个词的法度有关需求,写成 warning important 也能够。
我们假设 class 为 important 的全部元素凡是粗体,而 class 为 warning 的全体元素为斜体,class 中同时囊括 important 与 warning 的所有元素还有一个银色的布景 。即可以写作:
.important {font-weight:bold;} .warning {font-style:italic;} .important.warning {bac公斤round:silver;}
如需转载,请注明文章出处和来源网址:http://www.divcss5.com/css3-style/c52804.shtml