Rvssco
Rvssco

Reputation: 15

Focus a button and change the display of a div

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.

Upvotes: 1

Views: 294

Answers (1)

Nikita Skrebets
Nikita Skrebets

Reputation: 1542

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.

Upvotes: 1

Related Questions