-2
So people I am making a menu and wanted to discard the use of javascript with this I would like to make that when I pressed the mouse on the menu icon automatically my #content element would win a margin-top: 320px, look at my code:
///* CSS *///
#content{
margin-top: 50px
}
#menu img:hover + #content{
margin-top: 320px;
}
///* HTML *///
<div id="menu">
<img src="image.png">
</div>
<div id="content">
<hr>
</div>
Dude if you have to press the icon to open it, how will you take the mouse from the icon to click on the menu option? Once you take the mouse from the icon the menu will close and you will not be able to click on the menu items....
– hugocsl
I think you’ll have to use javascript.
– Augusto Vasques