How to Fix the Drop Down Menu Which is Malfunctioning? - html

My website's menu drop down seems to malfunction and it is stuck on the screen. Don't know how to fix http://www.kingadlerhomedecor.com/store/
I want to add more sub categories to this drop-down, but I wish to avoid making the drop down list too lengthy. I thus want 2 rows here in the drop-down to adjust the length list of sub-categories, but it doesn't seems to happen, instead there is a new problem - The drop-down menu item is half stuck and I am unable to fix this.
I have not made any changes and yet it seems to malfunction. No clue how to fix the dropdown menu stuck on my screen. Please advice.
/* MENU */
.primary-define #menu {
text-align: left;
font-family: helvetica, Arial;
/*background-color: #999;*/
}
.primary-define #menu-inner {
position: relative;
font-family: helvetica, Arial;
background-color: #999; /*No color was added origninally - added to make it grey*/
}
.primary-define .mainmenu {
margin: 0;
padding: 0;
position: relative;
list-style-type: none;
}
.primary-define .mainmenu li {
margin: 0;
padding: 0;
position: relative;
}
.primary-define .mainmenu > li {
float: left;
/*background-color: #999;*/
}
.primary-define .mainmenu li a {
color: #666; /*originial #666*/
display: block;
font-size: 10px; /*original 15px */
padding: 0.5px 1px; /*20px 25px */ /*Padding for the dropdown elements*/
text-decoration: none;
/*background-color: #999;*/
}
.primary-define .mainmenu > li > a {
color: #fff;
padding: 15px 25px; /*35px*/
font-size: 14px; /*original 18px */
font-weight: 600;
line-height: 100%;
font-family: helvetica, Arial;
}
.primary-define .mainmenu > li:hover > a,
.primary-define .mainmenu > li.active > a {
background-color: rgba(0, 0, 0, 1); /*rgba(0, 0, 0, 0.2)*/
/*font-size: 15px;*/
}
.primary-define .mainmenu li .dropdown-container {
top: 99%;
overflow: hidden;
position: absolute; /*absolute*/
padding-left: 1px; /*added by yuvi*/
font-size: 30px; /*added by yuvi*/
}
.primary-define .mainmenu li .dropdown {
margin-top: -300px; /*-999px*/
background-color: #fff;
border-left: 1px solid #eee;
border-bottom: 1px solid #eee;
font-size: 30px; /*added by yuvi*/
padding: 10px;
}
.primary-define .mainmenu li:hover .dropdown {
margin-top: 0;
/*font-size: 30px; added by yuvi*/
}
}
.primary-define .mainmenu ul {
margin: 0;
float: left;
width: auto; /*249px*/
list-style-type: none;
border-right: 1px solid #eee;
}
.primary-define .mainmenu ul li:hover a,
.primary-define .mainmenu ul li.active a {
background-color: #eee; /*orginiarl #eee*/

margin-top has to be -380px.
.primary-define .mainmenu li .dropdown {
margin-top: -380px;
background-color: #fff;
border-left: 1px solid #eee;
border-bottom: 1px solid #eee;
font-size: 30px;
padding: 10px;
}

Related

Scroll and border CSS issues

I am almost done w/ my menu here. However I have two issues.
I can't add a 1px solid border #fff on the last item of the list.
I need to remove the vertical scrollbar on the left.
Here's my CSS:
#nav li ul {
opacity: 0;
height: 0px;
}
#nav li a {
font-style: normal;
font-weight: 400;
position: relative;
display: block;
padding: 16px 25px;
color: #fff;
white-space: nowrap;
z-index: 2;
text-decoration: none
}
#nav li a:hover {
color: #c0392b;
background-color: #ecf0f1;
}
#nav ul li {
background-color: #e74c3c;
color: #fff;
display: block;
list-style: disc;
}
#nav li:first-child {
border-top: 1px solid #fff;
}
#nav ul {
margin: 0;
padding: 0;
}
#nav .fa { margin: 0px 17px 0px 0px; }
.logo {
width: 100%;
padding: 21px;
margin-bottom: 20px;
box-sizing: border-box;
}
#logo{
color: #fff;
font-size: 30px;
font-style: normal;
}
.sidebar-icon {
position: relative;
float: right;
text-align: center;
line-height: 1;
font-size: 25px;
padding: 6px 8px;
color: #fff;
}
.disp {
opacity: 1!important;
height:auto!important;
transition: height 100ms ease-in-out;
transition-delay: 300ms;
}
#nav li span:first-child {
margin-left: 32px;
}
asdasdasdasdasdasdasdassa
Well, first remove this:
#nav li:not(:last-child) {
border-bottom: 1px solid #fff;
}
for add border to all li even last one:
#nav li {
border-bottom: 1px solid #fff;
}
for removing scroll do this:
JS:
$('body, html').toggleClass('OverflowHidden');
CSS:
.OverflowHidden {
overflow: auto;
}
and for removing double border use this:
#nav li ul li:last-child {
border-bottom: none!important;
}
jsFiddle

Hover menu not working properly for submenus

I have a simple vertical hover menu and even when I don't hover over any buttons but the cursor is a little to the right of it, it shows the submenu. When there isn't a submenu the main menu button starts to flicker. I am not entirely sure what is going on and why it is happening. Here is link to show what I mean.
EDIT: Thank you for your responses! Now I'm having a different/almost same problem. The menu doesn't freak out any more, but now there's a bar that sticks out of it and it is still opening the submenus without having to hover over the parent menu. Link to picture here.
Here's my HTML
<div id="divMenu">
<ul>
<li>Home1</li>
<li>Home2
<ul>
<li>Homed</li>
<li>Homee</li>
<li>Homef</li>
</ul></li>
<li>Home3
<ul>
<li>Homeg</li>
<li>Homeh</li>
<li>Homei</li>
</ul></li>
<li>Home4</li>
<li>Home5
<ul>
<li>Homej</li>
<li>Homek</li>
<li>Homel</li>
</ul></li>
<li>Home6</li>
</ul>
</div>
And my CSS
<style type="text/css">
#divMenu {
margin: 0px;
padding: 0px;
}
#divMenu ul {
margin: 0px;
padding: 5px 15px;
}
#divMenu li {
margin: 4px;
padding: 4px;
}
#divMenu li li {
margin: 0px;
padding: 0px;
}
#divMenu {
width: 150px;
height: 27px;
}
#divMenu ul {
line-height: 25px;
}
#divMenu li {
list-style: none;
position: relative;
background: #000;
}
#divMenu li li {
list-style: none;
position: relative;
background: #000;
left: 95px;
top: -30px;
}
#divMenu ul li a {
width: 150px;
height: 25px;
padding: 5px 5px;
display: inline-block;
letter-spacing: 6px;
text-decoration: none;
text-align: left;
font-family: Quicksand Light;
color: #ffffff;
border: 0px;
}
#divMenu ul ul {
position: absolute;
visibility: hidden;
top: 27px;
}
#divMenu ul li:hover ul {
visibility: visible;
}
#divMenu li:hover {
background-color: #fff;
}
#divMenu ul li:hover > a {
background-color: #fff;
color: #000;
}
#divMenu a:hover {
font-weight: normal;
color: #000;
}
</style>
Just remove width:0px from #divMenu ul li:hover > a and #divMenu a:hover from your style.
The problem of the block tripping is because of the width in the block underneath:
#divMenu ul li a {
width: 150px;
height: 25px;
padding: 5px 5px;
display: inline-block;
letter-spacing: 6px;
text-decoration: none;
text-align: left;
font-family: Quicksand Light;
color: #ffffff;
border: 0px;
}
Just remove that width and it should work.
It's due to the zero width you're applying to the links. You really don't need that.
#divMenu ul li:hover > a {
/*width: 0px;*/
background-color: #fff;
color: #000;
}
#divMenu a:hover {
/*width: 0px;*/
font-weight: normal;
color: #000;
}
#divMenu {
margin: 0px;
padding: 0px;
}
#divMenu ul {
margin: 0px;
padding: 5px 15px;
}
#divMenu li {
margin: 4px;
padding: 4px;
}
#divMenu li li {
margin: 0px;
padding: 0px;
}
#divMenu {
width: 150px;
height: 27px;
}
#divMenu ul {
line-height: 25px;
}
#divMenu li {
list-style: none;
position: relative;
background: #000;
}
#divMenu li li {
list-style: none;
position: relative;
background: #000;
left: 95px;
top: -30px;
}
#divMenu ul li a {
width: 150px;
height: 25px;
padding: 5px 5px;
display: inline-block;
letter-spacing: 6px;
text-decoration: none;
text-align: left;
font-family: Quicksand Light;
color: #ffffff;
border: 0px;
}
#divMenu ul ul {
position: absolute;
visibility: hidden;
top: 27px;
}
#divMenu ul li:hover ul {
visibility: visible;
}
#divMenu li:hover {
background-color: #fff;
}
#divMenu ul li:hover > a {
/*width: 0px;*/
background-color: #fff;
color: #000;
}
#divMenu a:hover {
/*width: 0px;*/
font-weight: normal;
color: #000;
}
<div id="divMenu">
<ul>
<li>Home1</li>
<li>Home2
<ul>
<li>Homed</li>
<li>Homee</li>
<li>Homef</li>
</ul></li>
<li>Home3
<ul>
<li>Homeg</li>
<li>Homeh</li>
<li>Homei</li>
</ul></li>
<li>Home4</li>
<li>Home5
<ul>
<li>Homej</li>
<li>Homek</li>
<li>Homel</li>
</ul></li>
<li>Home6</li>
</ul>
</div>

Dropdown menu with css not working

I am facing some problem with this drop down menu thing. I read your article and it helped me. In the beginning, the drop down worked but when I added some more styling then it stopped working. Other divs and navigation bar is working fine but the drop down menu is not working. Can you please help me pointing out what should be corrected here?
The parent div is nav-bar-left and the style is
.nav-bar-left {
float; left;
overflow: hidden;
width: 980px;
height: 26px;
background-color: Lavender;
border: 1px solid MidnightBlue;
border-radius: 3px;
-moz-border-radius: 3px;
-webkit-border-radius: 3px;
}
The navigation div is #horizontalmenu which resides within the above parent div and the style is
#horizontalmenu {
width: 733px;
margin: 0;
position: relative;
float: left;
padding: 0;
}
Rest of the styling for navigation bar is
#navbar {
list-style-type: none;
margin: 0;
width: 100%;
padding: 0;
position: relative;
display: inline-table;
height: 26px;
z-index: 5;
}
#navbar li {
float: left;
position: relative;
}
#navbar a:link, #navbar a:visited {
display: block;
color: #333;
background-color: lavender;
text-align: center;
padding: 6px 10px;
border-style: solid;
border-color: MidnightBlue;
border-width: 0 1px 0 0;
text-decoration: none;
font-size: 14px;
line-height: 14px;
}
#navbar a:hover, #navbar a:active {
color: #fff;
background-color: #6b0c36;
text-decoration: underline;
}
#navbar ul {
left:-9999px;
list-style-type: none;
margin: 0;
padding: 0;
position: absolute;
}
#navbar ul li {
float:none;
border-style: solid;
border-color: Lavender;
border-width: 0 1px 1px 1px;
}
#navbar ul a {
white-space: nowrap;
}
#navbar li:hover ul {
left: 0;
}
#navbar:hover a {
text-decoration: none;
}
#navbar li:hover ul a {
text-decoration: none;
background-color: Lavender;
color: #333;
}
#navbar li:hover ul li a:hover {
background-color: Lavender;
color: #333;
}
So, why is it not working and what can be done?
I found this menu CSS one of my best collection for dropdown menu:
Create a Multilevel Dropdown menu with CSS and improve it via jQuery
And you can find a backup of those codes here in my pastebin.

How do I center my navigation bar links using CSS while keeping the sides grey?

How do I center my navigation bar links using CSS while keeping the sides grey?
Blogs and History have a drop a down menu. Here is a screenshot:
(source: gyazo.com)
CSS:
.navbar ul {
list-style: none;
margin: 0;
padding: 0;
}
.navbar li {
float: left;
width: 100px;
background-color: #444444;
text-align: center;
border-right: 1px solid white;
position: relative;
height: 30px;
line-height: 30px;
}
.navbar li ul li {
float: none;
width: 150px;
text-align: left;
padding-left: 5px;
border-top: 1px solid white;
}
.navbar a {
text-decoration: none;
color: white;
}
.navbar li ul {
position: absolute;
top: 30px;
left: 0;
visibility: hidden;
}
.navbar li:hover ul {
visibility: visible;
}
.navbar li:hover {
background-color: maroon;
}
Edited my answer.. I've made your Container div clear the float, and set a defined width to navbar.
http://jsfiddle.net/jFdhM/
#container {
border-radius: 10px;
box-shadow: 3px 3px 4px;
padding: 8px;
background-color: #FFFFFF;
width: 748px;
margin: 0 auto;
}
#top {
width: 748px;
}
.navbar {
width: 505px;
margin:0 auto;
}
.navbar ul {list-style:none; padding:0; margin: 0 auto;text-align: center;}
.navbar li {float:left; width:100px; background-color:#444444; text-align:center;
border-right:1px solid white; position:relative;
height:30px; line-height:30px;}
.navbar li ul li {float:none; width:150px; text-align:left; padding-left:5px;
border-top:1px solid white;}
.navbar a {text-decoration:none; color:white;}
.navbar li ul {position:absolute; top:30px; left:0; visibility:hidden;}
.navbar li:hover ul {visibility:visible;}
.navbar li:hover {background-color:maroon;}
#maincontent {
clear: both;
padding: 10px;
font-family: "Microsoft Sans Serif";
font-size: medium;
}

Why are my social media icons huge?

I tried to add some social media icons to my header just now and they are about 10 times larger than they should be. I've gone through the css and used firebug and I can't find what is doing this.
I would like them to be their regular size and sit on the top right of the header. Thanks in advance!!
Here's what it looks like ( http://www.bolistylus.com ):
Here's the style.css:
a {
color: #254655;
}
ul, ol {
margin: 0 0 0 5.5em;
}
#page {
margin: 0 auto;
}
body{
background: #f3f3f3;
border-top: none;
border-top: 10px solid #666666;
}
#page {
margin: 0em auto;
width: 1000px;
}
.singular.page .hentry {
padding: 0.5em 0 0;
}
#branding{
background: #f3f3f3;
color: #000000;
border-top: none;
position: relative;
z-index: 2;
}
#site-title {
/*margin-right: 270px;*/
padding: 0.66em 0 0 0;
}
#site-title a {
color: #111111;
font-size: 60px;
font-weight: bold;
line-height: 36px;
text-decoration: none;
}
#branding h1, header#branding a{
text-align: left;
margin-right: 0;
}
#branding span{
text-align: center;
}
#branding img {
height: auto;
margin-bottom: -.66em;
width: 30%;
}
#branding .widget{
position: absolute;
top: 2em;
right: 7.6%;
}
#respond{ background: #E7DFD6; }
.welcome{
margin: 15px 60px;
background: #f3f3f3;
border: 1px solid #f6ff96;
padding: 15px;
text-align: center;
}
/* =Menu
-------------------------------------------------------------- */
/*.header_nav ul{
margin: 0;
padding: 0;
text-align: center;
width: 400px;
}
*/
#branding img .sm-img {
height: auto;
margin-bottom: -.66em;
width: 100%;
}
.header_nav {
background: #f3f3f3
}
.header_nav .head-nav {
border-bottom: 1px solid #cfcec9;
border-top: 1px solid #cfcec9;
margin-top: 30px;
padding-top: 5px;
padding-bottom: 5px;
text-align: right
}
.header_nav ul li{
display: inline;
}
.header_nav ul li a{
padding: 10.5px 21px;
color: #000000;
}
.header_nav ul li a:hover, .menu ul li .current{
color: #a8cb17;
text-decoration: none;
}
#access {
background: #f3f3f3; /* Show a solid color for older browsers */
}
#access ul {
font-size: 13px;
list-style: none;
margin: 0 0 0 -0.8125em;
padding-left: 0;
}
#access li {
float: center;
position: relative;
display: inline;
}
#access a {
}
#access ul ul {
}
#access ul ul ul {
}
#access ul ul a {
}
#access a:focus {
}
#access li:hover > a,
#access a:focus {
}
#access ul li:hover > ul {
}
#access .current_page_item > a,
#access .current_page_ancestor > a {
font-weight: bold;
}
You're specifying a percentage width multiple times in your CSS, here are the lines:
style.css (line 70)
#branding img {
height: auto;
margin-bottom: -0.66em;
width: 30%; //remove
}
style.css (line 530)
#branding img {
height: auto;
margin-bottom: -7px;
width: 100%; //remove
}
Remove those and they should display ok.
Try to change your css here:
#branding img {
height: auto;
margin-bottom: -0.66em;
width: 3%; /* 3 not 30 */
}
In style.css line 70
Line 70 of your style.css is setting a width attribute with a value of 30%. This is causing your images to stretch to 30% of their container.
#branding img {
height: auto;
margin-bottom: -.66em;
width: 30%;
}
Adjust the width to a lower percentage or remove the line entirely.