プログラミング

CSSで”and”と”or”と否定(not)

CSSで”and”と”or”と否定(not)を実装する方法についてメモです。

and

<div class="class1 class2"></div>

div.class1.class2
{
  /* foo */
}

or

// 2つが当てはまる。
<div class="class1"></div>
<div class="class2"></div>

div.class1,
div.class2
{
  /* foo */
}

not

:not([id="foobar")

ref:
css selectors – CSS “and” and “or” – Stack Overflow
html – css class definition with multiple identifiers – Stack Overflow

コメントを残す

メールアドレスが公開されることはありません。 * が付いている欄は必須項目です