Home > database >  Focus a button and change the display of a div
Focus a button and change the display of a div

Time:12-07

I want to focus a button and make a div change the display to display:flex

This is the code pen link to be easier.

https://codepen.io/Rvssco/pen/bGoERxY

Thanks in advance.

CodePudding user response:

Had to make a rearrangement in div blocks: https://codepen.io/angelhearted/pen/wvrMjyE

  1. Moved menudrop to textBtn-wrap div. So the second point would work
  2. Use tilda selector: .buttonMenu:focus ~ .menudrop { display: flex; }
  3. There was a typo in the last selector, "l" in "display" was missing.
  • Related