{"id":14672202,"date":"2021-07-17T22:51:47","date_gmt":"2021-07-17T22:51:47","guid":{"rendered":"https:\/\/wordpress.org\/support\/topic\/dropdown-configuration\/"},"modified":"2021-07-17T22:57:14","modified_gmt":"2021-07-17T22:57:14","slug":"dropdown-configuration","status":"publish","type":"topic","link":"https:\/\/wordpress.org\/support\/topic\/dropdown-configuration\/","title":{"rendered":"Dropdown Configuration"},"content":{"rendered":"<p>Hello! Quick question about dropdown lists in the header (specifically the &#8220;Categories&#8221; option). I would like to put a 2px border around the dropdown, and also highlight the different options a certain color. I&#8217;ve done both of those things with the below code, but I know there&#8217;s a better way. <\/p>\n<p>The border is only appearing on hover, which means when I click the dropdown it fades in with a hover animation. I would like it to be there as soon as the dropdown is clicked, so that there is no fade-in animation.<\/p>\n<p>Also, there seems to be a margin on the top, left, and bottom of the dropdown box, so that the hover isn&#8217;t selecting the entire area. I would like for those margins to be removed (if possible) so that there&#8217;s no white space on the edges when hovering over a list option. I&#8217;d also like to remove the padding in between those list options as well.<\/p>\n<p>Here is the code. I tried li:hover instead of a:hover, but that didn&#8217;t work:<\/p>\n<pre><code>.menu-container ul.sub-menu\n{border-style: solid;\nborder-width: 2px}\n.menu-container ul.sub-menu a:hover\n{background-color: var(--p-body)}<\/code><\/pre>\n<p>Thank you!<\/p>\n","protected":false},"template":"","class_list":["post-14672202","topic","type-topic","status-publish","hentry"],"jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/wordpress.org\/support\/wp-json\/wp\/v2\/topic\/14672202","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/wordpress.org\/support\/wp-json\/wp\/v2\/topic"}],"about":[{"href":"https:\/\/wordpress.org\/support\/wp-json\/wp\/v2\/types\/topic"}],"version-history":[{"count":0,"href":"https:\/\/wordpress.org\/support\/wp-json\/wp\/v2\/topic\/14672202\/revisions"}],"wp:attachment":[{"href":"https:\/\/wordpress.org\/support\/wp-json\/wp\/v2\/media?parent=14672202"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}