{"id":54,"date":"2015-11-10T17:44:37","date_gmt":"2015-11-10T09:44:37","guid":{"rendered":"https:\/\/wp.winter-weng.cc\/work\/?p=54"},"modified":"2015-11-10T17:44:37","modified_gmt":"2015-11-10T09:44:37","slug":"css-%e7%95%b6%e6%bb%91%e9%bc%a0%e7%a7%bb%e9%81%8ea%e7%89%a9%e4%bb%b6%e6%99%82%ef%bc%8cb%e7%89%a9%e4%bb%b6%e6%94%b9%e8%ae%8a","status":"publish","type":"post","link":"https:\/\/wp.winter-weng.cc\/work\/?p=54","title":{"rendered":"[CSS] \u7576\u6ed1\u9f20\u79fb\u904eA\u7269\u4ef6\u6642\uff0cB\u7269\u4ef6\u6539\u8b8a"},"content":{"rendered":"<p>\u9019\u500b\u4e8b\u4ef6\u5f88\u5e38\u6703\u4f7f\u7528JS\u4f86\u505a\uff0c\u4f46\u6700\u8fd1\u89ba\u5f97\u53ef\u4ee5\u7528CSS\u89e3\u6c7a\u7684\u4e8b\u5c31\u76e1\u91cf\u5c11\u7528JS<br \/>\n\u89e3\u6cd5\u5176\u5be6\u4e5f\u5f88\u7c21\u55ae\uff0c\u53ea\u8981\u628aselector\u653e\u5728A\u7269\u4ef6:hover\u5f8c\u9762\u5c31\u80fd\u5be6\u73fe<br \/>\n<a href=\"http:\/\/stackoverflow.com\/questions\/4502633\/how-to-affect-other-elements-when-a-div-is-hovered\" target=\"_blank\" rel=\"noopener\">\u53c3\u8003<\/a><br \/>\nIf the cube is directly inside the container:<\/p>\n<pre class=\"lang:css decode:true\">#container:hover &gt; #cube { background-color: yellow; }\n<\/pre>\n<p>If cube is next to (after containers closing tag) the container:<\/p>\n<pre class=\"lang:css decode:true\">#container:hover + #cube { background-color: yellow; }\n<\/pre>\n<p>If the cube is somewhere inside the container:<\/p>\n<pre class=\"lang:css decode:true\">#container:hover #cube { background-color: yellow; }\n<\/pre>\n","protected":false},"excerpt":{"rendered":"<p>\u9019\u500b\u4e8b\u4ef6\u5f88\u5e38\u6703\u4f7f\u7528JS\u4f86\u505a\uff0c\u4f46\u6700\u8fd1\u89ba\u5f97\u53ef\u4ee5\u7528CSS&hellip;<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"pgc_sgb_lightbox_settings":"","footnotes":""},"categories":[3],"tags":[],"class_list":["post-54","post","type-post","status-publish","format-standard","hentry","category-css"],"_links":{"self":[{"href":"https:\/\/wp.winter-weng.cc\/work\/index.php?rest_route=\/wp\/v2\/posts\/54","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/wp.winter-weng.cc\/work\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/wp.winter-weng.cc\/work\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/wp.winter-weng.cc\/work\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/wp.winter-weng.cc\/work\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=54"}],"version-history":[{"count":0,"href":"https:\/\/wp.winter-weng.cc\/work\/index.php?rest_route=\/wp\/v2\/posts\/54\/revisions"}],"wp:attachment":[{"href":"https:\/\/wp.winter-weng.cc\/work\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=54"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/wp.winter-weng.cc\/work\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=54"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/wp.winter-weng.cc\/work\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=54"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}