I have a little problem with centering my dropdown menu. I've tried everything said on Google and this forum, but nothing helps and therefore i hope that some of you guys will help me!
My page can be seen here testpage. Here you can see how misplaced my dropdown menu are. I wan't it to be centered.
You can do it by:
Removing float: left from li elements.
Adding display: inline-block to li elements.
Adding text-align: center to ul element.
Related
I can't find a way to make my header dropdown to be positioned the way I want it to. First off, the dropdown is horizontal, while it is supposed to stack up under each other. Second, the dropdown is not vertically aligned with the parent link, so I want it to be directly under its parent link and not a few pixels to the right of it. Using the left: __% only worked on one while totally pulling off track the other dropdown of a different parent, so it wasn't relative to the position of the parent of the dropdown.
Here is the jsfiddle: https://jsfiddle.net/u6v44hdw/
I'm having trouble and I think I'm supposed to add the code here somewhere:
li ul {
display: none;
position: absolute;
top: 15%;
padding-left: 1px;
}
Thanks!
Your missing the class="sub" in <ul> sub menu.
Edit:
Here is he full example of what you want: https://jsfiddle.net/u6v44hdw/2/
Edit2: I think you don't need that z-index.
As can be demonstrated in this fiddle, adding too many elements in a Bootstrap .nav causes it to just add items vertically down. How would I go about limiting its height and making it horizontally scrollable?
First you need to tell the ul to not wrap and overflow into a scroll bar. Then the li elements need to not be floated and display inline. This will do it:
ul.nav {
white-space: nowrap;
overflow-x: auto;
}
ul.nav li {
display: inline-block;
float: none;
}
Fiddle: http://jsfiddle.net/bmfcd3zt/8/
Try this:
.nav{flex-wrap:nowrap;overflow-x:auto}
First, here is a fiddle that I've found on a scrolling implementation of tabs.
Second, I don't think that it's a good UX to provide so many links in a tabbar. I recommend you to use dropdown menus or mega menu.
I'm attempting to learn some things about css and html, and I'm currently playing with webpage menus.
I've been using this website: (http://www.cssportal.com/css3-menu-generator/) to play with stuff visually and infer the syntax by how the code elements are changing however, this generator is missing a feature I want to understand: Aligning the list horizontally.
how could the output of this generator be edited so that the buttons are aligned with the center of the menu bar instead of the left?
Instead of floating the lis, you can set them to display: inline-block:
.menu {text-align: center;}
.menu > li {display: inline-block;}
I designed a vertical menu using CSS, li and ul tags. It works fine, but just for many hints. After some time, hover effect works just for the last item.
Please look at my project here: http://www.saberi.ws/test/
Please move your mouse on the menu in the left side (Products, Countries, ...) to see this in action.
You can see related CSS file here.
Your #ticker is lying in front of your navigation. Add z-index: 0 to your #ticker and add position: relative; z-index: 1 to your #container_left_menu.
This will move your navigation over your ticker. The position: relative is neccessary, because z-index does only work with position:absolute, position:relative, or position:fixed.
http://www.w3schools.com/cssref/pr_pos_z-index.asp
My solution is much simpler, to my mind. Simply add overflow: hidden; to your #news.
I have menu made with Superfish jquery plugin http://users.tpg.com.au/j_birch/plugins/superfish
But i have some problems with that, it is added padding when i view my page in Firefox, Chrome and IE:
Here is the jsfiddle sample http://jsfiddle.net/YsG97/2/
May be some one may suggest how to remove this spacing between Superfish menu ul and header div?
and there is strange thing i indecently find out, if i put   after menu closing tag: </ul> it is fixed spacing in Firefox, don't know why. May be some one may explain?
Here you go:
#menucontainer {
...
vertical-align: top;
}
Live demo: http://jsfiddle.net/YsG97/5/
The #menucontainer DIV has display: inline-block set, which effectively makes it an inline element. Inline elements are by default aligned to the baseline, which means that there will be space below them (between the baseline and the descender):
http://vidasp.net/media/CSS-vertical-align.gif
If you add a clearing element after the closing ul tag, it matches up to the bottom. there is a problem with the floats, not sure what the problem is but this fixes it (although with increased height in the #menucontainer div.
See here.