Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
たとえば、クラス 'demo1' がdisplay:blockクラス 'demo2' の場合、自動的にdisplay:None
display:block
display:None
簡単な答え :いいえ
回避策: Javascript または jQuery を使用します。.toggle()
.toggle()
CSSに固執したい場合は、次のようなことができます
div[style*="block"] + div { display: none; }
デモ
上記のセレクターはdiv、属性にstyle含まれている値が含まれているかどうかを確認しblockます。adjacent div+
div
style
block
adjacent
+