CSSではワイルドカード指定ができます。
(1)つなげてしまう。
class="register_top"
class="register_bottom"
class="check_top"
class="check_bottom"
(2)クラスをパーツ化する。
class="register top"
class="register bottom"
class="check top"
class="check bottom"
(1)の場合CSSは
CSS
1[class^="register"]{ 2 3} 4[class$="top"]{ 5 6} 7[class^="check"][class$="bottom"]{ 8 9}
などとなります。(2)の場合は
CSS
1.register{ 2 3} 4.check{ 5 6} 7.top{ 8 9} 10.bottom{ 11 12} 13
となります。
どちらのほうが良いでしょうか?デメリット、メリットなどありましたら教えていただけますと幸いです。
回答2件
あなたの回答
tips
プレビュー