WebsiteBaker Logo
  • *
  • Templates
  • Help
  • Add-ons
  • Download
  • Home
*
Welcome, Guest. Please login or register.

Login with username, password and session length
 

News


WebsiteBaker 2.13.6 is now available!


Will it continue with WB? It goes on! | Geht es mit WB weiter? Es geht weiter!
https://forum.websitebaker.org/index.php/topic,32340.msg226702.html#msg226702


The forum email address board@websitebaker.org is working again
https://forum.websitebaker.org/index.php/topic,32358.0.html


R.I.P Dietmar (luisehahne) and thank you for all your valuable work for WB
https://forum.websitebaker.org/index.php/topic,32355.0.html


* Support WebsiteBaker

Your donations will help to:

  • Pay for our dedicated server
  • Pay for domain registration
  • and much more!

You can donate by clicking on the button below.


  • Home
  • Help
  • Search
  • Login
  • Register

  • WebsiteBaker Community Forum »
  • General Community »
  • Off-Topic »
  • vertical alignment (spacing) of menu and child menu
  • Print
Pages: [1]   Go Down

Author Topic: vertical alignment (spacing) of menu and child menu  (Read 5866 times)

Offline sky writer

  • Posts: 926
vertical alignment (spacing) of menu and child menu
« on: January 07, 2009, 08:39:57 PM »
I have been at this for some time, and can't seem to get it just right.

I have a fairly simple vertical menu structure (Templeron Template) with background color boxes (which change colour when hovered over) around each text link.

Home

Link 1

   Link 1 child 1

   Link 1 child 2

Link 2

What I would like to do is decrease the vertical spacing of the parent/child menu items, so it looks like this:

Home

Link 1
   Link 1 child 1
   Link 1 child 2

Link 2

But for the life of me, I can't seem to get it right.  Can anyone offer any assistance.  I am willing to read and learn myself, but I have searched here and Google and can't find any reference to doing this.

Here is the menu CSS info:

.menu {
    vertical-align: top;
    background-color: #FFFFFF;
    width: 170px;
    padding: 0px;
}
.menu ul, .menu li{
    list-style-type: none;
    margin: 0;
    padding: 0;
}
.menu ul {
    border-bottom: 0px;
    background-color: #003366;
}
.menu ul ul {
    font-style: italic;
    padding-left: 10px;
}
.menu a:link, .menu a:visited, .menu a:active {
    padding: 4px 10px 4px 10px;
    color: #FFFFFF;
    display: block;
    background-color: #003366;
    text-decoration: none;
}
.menu a:hover {
    background-color: #336699;
    text-decoration: none;
}
.menu_current {
    font-weight: bold;
}
Logged

Offline marathoner

  • Posts: 495
Re: vertical alignment (spacing) of menu and child menu
« Reply #1 on: January 08, 2009, 02:46:42 AM »
You don't give us much info such as a URL or anything. I'm going to *guess* that your child links are in a nested UL tag. However, you define links (A tag) with a top and bottom padding of 10px. Since you haven't defined anything different for the A tags in the nested UL they will inherit that properties of the A tags that you have defined.

Do a Google search on CSS to understand how cascading works. Also, you might want to try something like the 'Web Developer' addon for FF so that you can see information such as where a particular element falls in your CSS heirarchy and it also allows you to alter the CSS and see the results immediately.

It's probably something like this:
Code: [Select]
.menu UL UL a:link, .menu a:visited, .menu a:active {
   padding: 4px 0px;
}
Logged

  • Print
Pages: [1]   Go Up
  • WebsiteBaker Community Forum »
  • General Community »
  • Off-Topic »
  • vertical alignment (spacing) of menu and child menu
 

  • SMF 2.0.19 | SMF © 2017, Simple Machines
  • XHTML
  • RSS
  • WAP2