Is there any way for me to use a div as a dropdown menu positio exactly like this? I already tried absolute position but it doesn’t work with other screen size. What I want is for it to work on all screen resolutions. I tried using tables(hiding the td and showing it on hover)but the menu just pushes the contents below it. I desperately need to get this sorted out I’ve been working on it for weeks now and still not even close to what I want. Thank you in advance.
What I tried so far:
jQuery:
$(document).ready(function(){
$("#hover-here").hover(function(){
$("#boxed-menu-div").toggle();
});
});
CSS:
#boxed-menu-div{
display: none;
position: absolute;
top: 100px;
right: 246px;
}
This works perfectly only on my screen resolution. I used relative positioning but it only pushes the contents below. Is there any other alternatives to what absolute can do?
Ok… First things first. Tables are a definite no and you don’t need jQuery either.
You have four html elements that combined are designed to do this specific task.
These are
<nav>,<ul><li>and<a>. Now I’m making an assumption here that since you want it to work on all screen sizes then you are wanting this to be responsive, I’m also assuming that since you want rounded corners, gradients, shadows etc then you will be aiming for modern browsers, ie9+ and the others.Bearing that in mind here would be the html I would use to create a menu.
The css would go something like this. Please note that I have only created a very rough approximation of what you are after.
I’ve included a working example here for you to play with. As you can see this will work from mobile-up. Fullscreen link here resize to see it working.