我可能使用了错误的词汇,这就是为什么我找不到问题的答案。
我正在尝试找到如何在css上定义多种类型的“标记”。例如,我想定义两种类型的textarea。
<style type="text/css">
textarea.1 {width: 100%; background-color:rgba(100,100,100,0.7)}
textarea.2 {width: 50%; background-color:rgba(100,100,100,0.7)}
A img.1 {width:40px ; height:40px;}
</style>
只能称之为:
<textarea.1>
..
</textare.1>
答案 0 :(得分:0)
首先 - 不要使用数字作为班级指标(不要将数字用作任何变量,使用字母)。它不适用于CSS,通常会导致问题。
你想要的是为textarea定义一个类,你可以在CSS中引用它。像这样:
<style type="text/css">
textarea.one {width: 100%; background-color:rgba(100,100,100,0.7)}
textarea.two {width: 50%; background-color:rgba(100,100,100,0.7)}
A img.one {width:40px ; height:40px;}
</style>
<textarea class="one">
..
</textarea class="two">