Community @ The Turning Gate

Support community for TTG plugins and products.

NOTICE

The Turning Gate's Community has moved to a new home, at https://discourse.theturninggate.net.

This forum is now closed, and exists here as a read-only archive.

  • New user registrations are disabled.
  • Users cannot create new topics.
  • Users cannot reply to existing topics.

You are not logged in.

#1 2016-10-11 19:00:32

christopherhauser
Member
Registered: 2013-06-05
Posts: 71

[FIXED] How to fix the sub menu / drop down?

I tried myself on styling the menu. (changing spacing and so on)

Now I have a hard time figuring out how to adjust the drop down menu so that it works again.

Here is the CSS I'm using so far. Probably not very clean or anything but it works for the main navigation...

Any help would be much appreciated! Thanks a lot.

.primary-menu {
    border-top: 0px solid black;
    border-bottom: 0px solid black;
    line-height: 12px;
    padding: 6px 0px 0px 0px;   
}

.menu-item a:link, a:visited {
    color: #000000;
    line-height: 12px;
    height: 12px;
    font-size: 12px;
    padding: 0px 9px 0px 9px;
}

.menu-item span {
    color: #000000;
    line-height: 12px;
    height: 12px;
    font-size: 12px;
    padding: 0px 9px 0px 9px;       
}

.menu-item li {
    a: #ffffff;
    line-height: 24px;
    height: 24px;
    padding: 0px 6px 0px 6px;
}

Last edited by christopherhauser (2016-10-13 18:41:41)

Offline

#2 2016-10-11 21:38:01

lofty
Member
From: UK
Registered: 2012-09-26
Posts: 259
Website

Re: [FIXED] How to fix the sub menu / drop down?

Hi Christopher,

Can you post a link to your site please, then we can get a look at what is happening?

Offline

#3 2016-10-11 22:10:13

christopherhauser
Member
Registered: 2013-06-05
Posts: 71

Re: [FIXED] How to fix the sub menu / drop down?

.... haha how stupid of me, I was so taken with the code that i forgot the URL... here you go http://chauser.eu/cp/en/

Offline

#4 2016-10-11 22:24:07

rod barbee
Moderator
From: Port Ludlow, WA USA
Registered: 2012-09-24
Posts: 17,830
Website

Re: [FIXED] How to fix the sub menu / drop down?

one thing really quick:

.menu-item li {
    a: #ffffff;
    line-height: 24px;
    height: 24px;
    padding: 0px 6px 0px 6px;
}

a: #ffffff; is not correct. a is a selector for an anchor element.
did you mean to set the list element to white? Or were you trying to set a color for an anchor element inside a list element?


Rod 
Just a user with way too much time on his hands.
www.rodbarbee.com
ttg-tips.com, Backlight 2/3 test site

Offline

#5 2016-10-11 22:30:41

christopherhauser
Member
Registered: 2013-06-05
Posts: 71

Re: [FIXED] How to fix the sub menu / drop down?

rod barbee wrote:

one thing really quick:

.menu-item li {
    a: #ffffff;
    line-height: 24px;
    height: 24px;
    padding: 0px 6px 0px 6px;
}

a: #ffffff; is not correct. a is a selector for an anchor element.
did you mean to set the list element to white? Or were you trying to set a color for an anchor element inside a list element?


I deleted it. It was just there from the beginning seeing what "li" actually changes.

Now it reads:

.menu-item li {
    line-height: 24px;
    height: 24px;
    padding: 0px 6px 0px 6px;

}

the problem is still the gab, between the main navigation and the dropdown.

Offline

#6 2016-10-11 22:57:58

rod barbee
Moderator
From: Port Ludlow, WA USA
Registered: 2012-09-24
Posts: 17,830
Website

Re: [FIXED] How to fix the sub menu / drop down?

.menu-item span {
    color: #000000;
    line-height: 12px;
    height: 12px;
    font-size: 12px;
    padding: 0px 9px 0px 9px;       
}

This is what's keeping the drop-downs from working correctly. Specifically, it looks like height: 12px; is messing things up. Span in an inline element so I don't think you can assign a height or width to it.

Are you trying to target the sub-menu list items (the drop downs) with this:

.menu-item li {
    line-height: 24px;
    height: 24px;
    padding: 0px 6px 0px 6px;
}

That may not work as you wish because it may not be specific enough. So if what you want to happen is not, try something like this as the selector:

ul.sub-menu li.menu-item


Rod 
Just a user with way too much time on his hands.
www.rodbarbee.com
ttg-tips.com, Backlight 2/3 test site

Offline

#7 2016-10-11 23:18:52

christopherhauser
Member
Registered: 2013-06-05
Posts: 71

Re: [FIXED] How to fix the sub menu / drop down?

Hm, I will look into it.

Another question why is the Vegas Slideshow not showing up?  ( http://chauser.eu/cp/en/home/ )

Never mind... It shows up now...

Last edited by christopherhauser (2016-10-11 23:33:30)

Offline

#8 2016-10-11 23:21:52

christopherhauser
Member
Registered: 2013-06-05
Posts: 71

Re: [FIXED] How to fix the sub menu / drop down?

when I delet:

.menu-item span {
    color: #000000;
    line-height: 12px;
    height: 12px;
    font-size: 12px;
    padding: 0px 9px 0px 9px;       
}

the drop down is closer again, hwoever I have way to much space between the header and the menu...

Offline

#9 2016-10-11 23:34:53

christopherhauser
Member
Registered: 2013-06-05
Posts: 71

Re: [FIXED] How to fix the sub menu / drop down?

Ok here we are; Problem: Distance between header and manu to big and the distance between "info" and the rest is to big...

here is the current code:

.primary-menu {
    border-top: 0px solid black;
    border-bottom: 0px solid black;
    line-height: 12px;
    padding: 0px 0px 0px 0px;
   
   
}


.menu-item a:link, a:visited {
    color: #000000;
    line-height: 12px;
    height: 12px;
    font-size: 12px;
    padding: 0px 8px 0px 8px;

}



.menu-item li {
    border-top: 0px solid black;
    line-height: 24px;
    height: 24px;
    padding: 0px 6px 0px 6px;
}


.menu-item a:link, a:visited {
    color: #000000;
}

.menu-item a:hover {
    color: #2196F3;
}

Offline

#10 2016-10-11 23:36:27

rod barbee
Moderator
From: Port Ludlow, WA USA
Registered: 2012-09-24
Posts: 17,830
Website

Re: [FIXED] How to fix the sub menu / drop down?

the drop down is closer again, hwoever I have way to much space between the header and the menu...

Have you tried adjusting the masthead padding?


Rod 
Just a user with way too much time on his hands.
www.rodbarbee.com
ttg-tips.com, Backlight 2/3 test site

Offline

#11 2016-10-12 01:14:07

lofty
Member
From: UK
Registered: 2012-09-26
Posts: 259
Website

Re: [FIXED] How to fix the sub menu / drop down?

Hi Christopher,

Looks like you have your primary-menu line height set here to 12px

.primary-menu {
    border-top: 0px solid black;
    border-bottom: 0px solid black;
    line-height: 12px;
    padding: 0px 0px 0px 0px;
   
   
}

But you also have a line height of 44px set for the nav which I think is set in Backlight.

nav a, nav span {
    height: 44px;
    line-height: 44px;
}

I believe that the span element is pushing your drop down away from the rest of the menu.

Try setting the height of your navigation in Backlight to 12px

Offline

#12 2016-10-12 17:09:56

christopherhauser
Member
Registered: 2013-06-05
Posts: 71

Re: [FIXED] How to fix the sub menu / drop down?

rod barbee wrote:

the drop down is closer again, hwoever I have way to much space between the header and the menu...

Have you tried adjusting the masthead padding?

Yes, but that is nor the problem. (If changing it it moves the border not closer or further away from the logo)

I fixed the distance between the navigation and the distance to the logo with:


.menu-item span {
    line-height: 12px;
    padding: 0px 8px 0px 8px;   
}

The problem I still have is fixing and editing the actual drop down menu. I have trouble just targeting it and changing it. Currently it is to far away from the menu...

If you check the site it might take a few refreshs as I'm currently trying to target it with different approaches...

EDIT: I can target it with .menu-item li the problem is only I don't have a clue how to move it.

Last edited by christopherhauser (2016-10-12 17:17:15)

Offline

#13 2016-10-12 19:43:09

Matthew
Administrator
From: San Francisco, CA
Registered: 2012-09-24
Posts: 5,795
Website

Re: [FIXED] How to fix the sub menu / drop down?

In general, you should look at the existing stylesheet and how it's already targeting things, then use the same format.


Matt

The Turning Gate, http://theturninggate.net

Offline

#14 2016-10-12 20:27:36

christopherhauser
Member
Registered: 2013-06-05
Posts: 71

Re: [FIXED] How to fix the sub menu / drop down?

aha...

Offline

#15 2016-10-13 01:20:49

christopherhauser
Member
Registered: 2013-06-05
Posts: 71

Re: [FIXED] How to fix the sub menu / drop down?

No really any progress... So how do I move the dump thing ? AND WHY are the links with the drop down blue...

Here is the current code: I tried to explain what everything does, NOW I tried a lot...

(is used to space everything from the header)
.primary-menu {
    padding: 6px 0px 0px 0px;
}

(used to set size and distance between main links)
.menu-item a:link, a:visited {
    line-height: 12px;
    height: 12px;
    font-size: 14px;
    padding: 0px 8px 0px 8px;
}

(used to size and set distance between "info" and the rest.)
.menu-item span {
    line-height: 12px;
    padding: 0px 8px 0px 8px;
    font-size: 14px;
}

(used for the shadow around the WHOLE box and some transparency test.)
.sub-menu {
    box-shadow: 0px 0px 16px 0px rgba(0,0,0,0.2);
    background-color: rgba(255, 255, 255, 0);
}

(used to make some space around the sub links... and some transparency test.)
.menu-item-has-children ul.sub-menu li {
        background-color: rgba(255, 255, 255, 0.5);
    padding: 4px 4px 4px 4px;   
}

Offline

#16 2016-10-13 18:40:03

christopherhauser
Member
Registered: 2013-06-05
Posts: 71

Re: [FIXED] How to fix the sub menu / drop down?

Ok fixed the nav bar...

Offline

#17 2016-10-13 18:41:20

christopherhauser
Member
Registered: 2013-06-05
Posts: 71

Re: [FIXED] How to fix the sub menu / drop down?

Final code for the nav:

.primary-menu {
    padding: 6px 0px 0px 0px;
   
}


.menu-item a:link, a:visited {
    line-height: 12px;
    height: 16px;
    font-size: 14px;
    padding: 0px 8px 0px 8px;

}




.menu-item span {
    line-height: 12px;
    padding: 0px 8px 0px 8px;
    font-size: 14px;
    height: 16px;
    position:relative;
}




.sub-menu {
    box-shadow: 0px 4px 4px 0px rgba(0,0,0,0.1);
   
}


.menu-item-has-children ul.sub-menu li {
    padding: 4px 4px 4px 4px;
    position:relative;

   
}

.menu-item-has-children ul.sub-menu {
    border:0px solid #000000;
}

   

nav ul li:hover > ul { top: 16px; }

nav li:hover a,nav li:hover span { color: #000000; }

nav li:hover,nav li:hover li { background-color: #ffffff; }

nav li a:hover,nav li span:hover { color: #2196f3; background-color: #ffffff; }

Offline

Board footer

Powered by FluxBB