Y
Y
Yurii9312022-04-17 15:49:45
css
Yurii931, 2022-04-17 15:49:45

How to make it so that when you click on the "MENU" button, the burger opens (using CSS only) and automatically adds an indent for another block?

How to make it so that when you click on the "MENU" button, the burger opens (the condition that the burger is only using CSS) and explicitly adds an indent for another block?
(at screen width 480px)

https://jsfiddle.net/Yurii931/u9qndjw3/

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Anton Shamanov, 2022-04-17
@SilenceOfWinter

https://jsfiddle.net does not work in Russia. Purely practical: you wrap the menu in a label and add a hidden checkbox in front of the menu:

.burger-menu {display: none;}
.burger-checkbox:checked + .burger-menu {display: block;}

But semantically, this is such a solution.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question