私は、 *
を入れずに代わりに擬似要素(:after
)を使用することをお勧めします。そうすれば、より良い結果を簡単に得ることができます。
See this EXAMPLE.
よりクリーンなマークアップに注意してください:
すべての .required
ラベルは、それに適用される:after
擬似要素のおかげで、
label.required:after {
content: '*';
}
Important Note: The mentioned solution will fail on IE7 and below, as they do not support pseudo elements.