Positioning Spry Menu Bar, etc.

This is a discussion on "Positioning Spry Menu Bar, etc." within the Web Page Design section. This forum, and the thread "Positioning Spry Menu Bar, etc. are both part of the Design Your Website category.


 Subscribe in a reader

Go Back   Webforumz.com > Main Forums > Design Your Website > Web Page Design

Notices




Reply
 
LinkBack Thread Tools
  #1  
Old Sep 9th, 2007, 17:47
Junior Member
Join Date: May 2007
Location: Virginia
Posts: 19
Thanks: 0
Thanked 0 Times in 0 Posts
Positioning Spry Menu Bar, etc.

(First time using DW, bear with me ...)

I'm trying to modify my spry menu bar so it integrates with my page like this:

nav2mh3.jpg

But right now it looks like this:

nav3wy2.jpg

The menu bar is in a table cell, along with a sliced 800 x 25 px .gif (the gradiant image right below it) which I'd like the menu bar to be on top of.

I'm stuck on how do the following, and I've searched everywhere:

1. What CSS property to I chage to align the menu bar to the right, just so it aligns with the right edge of the large content box below it?

2. How can I make the menu bar be on top of the 800 x 25 px .gif (currently right below it, in the same table cell). I tried to delete the .gif from the table and set it instead as a background image of the Spry Menu, but that didn't work (I may have set the wrong CSS property.)

3. How do I decrease the height of the pipes (actually, solid right borders) which separate the menu items? (see first image for desired look). I tried to change the height and padding properties for Box in ul.MenuBarHorizontal a. I changed the height from "auto" to something like 7 px (or should I use points? ems?). That decreased the height but the words were no longer centered vertically within the menu (too close to the bottom border), so I changed the Box padding from 0.5 em 0.75 em to 0.3 em 0.75 em but that moved the bottom of the box closer to the text. (I also tried 0.5 0.75em 0.5em but that made it worse.)

4. How can I not show the last pipe (after CONTACT).

Thank you for any pointers. There are so many css properties for the spry menu and I'm having trouble finding good documentation about what each one does.

Last edited by karinne; Sep 10th, 2007 at 13:59. Reason: Please attach big images!
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote

  #2  
Old Sep 9th, 2007, 18:11
Junior Member
Join Date: May 2007
Location: Virginia
Posts: 19
Thanks: 0
Thanked 0 Times in 0 Posts
Re: Positioning Spry Menu Bar, etc.

I just somehow managed to screw it up further and the menu is now vertical. I can't figure out what I changed and clicking undo didn't restore it.

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #3  
Old Sep 10th, 2007, 01:23
Reputable Member
Join Date: Jul 2005
Location: Indiana, USA
Age: 29
Posts: 153
Blog Entries: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Re: Positioning Spry Menu Bar, etc.

Do you have a development site with this so we can work on it for you. It'd be a lot easier to just open up my web dev toolbar and slap some css changes and get it all squared away for you.

(if not, you'll need to set the LI to either display: inline; or float: left; depending on your situation. Then you'll likely need to use position: absolute; and adjust the top and left values to position it where you want it. Keep in mind though this is just speculation since I don't know how you've coded it)

- James
Last Blog Entry: Whats in a name? (Feb 20th, 2008)
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #4  
Old Sep 10th, 2007, 13:58
Elite Veteran
Join Date: Jan 2007
Location: You know where
Age: 31
Posts: 4,617
Thanks: 0
Thanked 0 Times in 0 Posts
Re: Positioning Spry Menu Bar, etc.

I gave you some code in your other thread which should get "almost" the desired result ...

http://www.webforumz.com/graphics-fo...htm#post262505

Quote:
Originally Posted by karinne View Post
Nothing to do in PS ... all code.

Your code should look something like this

HTML
Code: Select all
<div id="navigation">
<ul>
    <li><a href="">Home</a></li>
    <li><a href="">Images</a></li>
    <li><a href="">Multimedia</a></li>
    etc....
</ul>
</div>
CSS
Code: Select all
#navigation {
    margin: 0;
    padding: 0;
}

#navigation ul {
    list-style: none;
    margin: 0;
    padding: 0;
}

#navigation ul li {
   margin: 0;
   padding: 0;
   display: inline;
   float: left;
}

#navigation ul li a {
   text-transform: uppercase;
   padding: 0 10px;
   border-right: 1px solid #fff;
   color: #fff;
}

#navigation ul li a:hover {
   color: #900;
}
Something like that ... I haven't tested so ...

Have a look at Alistapart's Taming List article for more info on how to styles lists for menus.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #5  
Old Sep 11th, 2007, 03:41
Junior Member
Join Date: May 2007
Location: Virginia
Posts: 19
Thanks: 0
Thanked 0 Times in 0 Posts
Re: Positioning Spry Menu Bar, etc.

Quote:
Originally Posted by karinne View Post
I gave you some code in your other thread which should get "almost" the desired result ...
Yes! This is working much better than the 400 other options I've tried.

Now, just to verify some of my learning:

This code defines the (overall?) properties for the "navigation" div id listed in the HTML code:

Code: Select all
#navigation {
    margin: 0;
    padding: 0;
}
This code further defines it as an unordered list (ul):

Code: Select all
#navigation ul {
    list-style: none;
    margin: 0;
    padding: 0;
}
This code defines (which?) properties for the list items (li) that are in the underordered list:

Code: Select all
#navigation ul li {
   margin: 0;
   padding: 0;
   display: inline;
   float: right;
}
This code defines the text properties for the list items (li); the "a" makes it a hyperlink:

Code: Select all
#navigation ul li a {
   text-transform: uppercase;
   padding: 0 10px;
   border-right: 1px solid #fff;
   color: #fff;
}
This code defines the properties when the mouse hovers over the list items ...

Code: Select all
#navigation ul li a:hover {
   color: #900;
}
I changed the float property for #navigation ul li to "right", and now need to move the list over to the left a bit. I tried making changes to padding, margin, and position but this had no noticable affect. Since the list div is inside a table cell, should I change the properties of the table cell instead?

Thank you again for your help.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #6  
Old Sep 11th, 2007, 04:13
Junior Member
Join Date: May 2007
Location: Virginia
Posts: 19
Thanks: 0
Thanked 0 Times in 0 Posts
Re: Positioning Spry Menu Bar, etc.

I took a tip from Alistapart's Taming List article and tried to get rid of the right border on the last list item (CONTACT). THe changes I made had no obvious impact:

I edited the navigation div like so:

Code: Select all
 
<div id="navigation">
   <ul>
      <li class="last"><a href="contact.html">Contact</a></li>
      etc.
   </ul>
</div>
I then added this to the .css file:

Code: Select all
 
#navigation ul li a.last {
   border-right: none;
}
Also, when I floated the list to the right, the order of the items reversed when viewed in the broswer. I had to edit the div by listing the items in reverse order (starting with CONTACT and ending with HOME) for them to appear in the proper order in the browser. Odd?
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #7  
Old Sep 11th, 2007, 09:14
Most Reputable Member
Join Date: May 2007
Location: UK
Age: 27
Posts: 1,111
Thanks: 0
Thanked 0 Times in 0 Posts
Re: Positioning Spry Menu Bar, etc.

Code: Select all
 
#navigation ul li a.last {
   border-right: none;
}
Your selector does not match your HTML. a.last selects all <a> elements with the className "last". Since you don't have any of these, the CSS does nothing to your page.

You need this instead:

Code: Select all
 
#navigation ul li.last a {
   border-right: none;
}
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #8  
Old Sep 11th, 2007, 22:49
Junior Member
Join Date: May 2007
Location: Virginia
Posts: 19
Thanks: 0
Thanked 0 Times in 0 Posts
Re: Positioning Spry Menu Bar, etc.

Quote:
Originally Posted by MikeHopley View Post
Code: Select all
 
#navigation ul li a.last {
   border-right: none;
}
Your selector does not match your HTML. a.last selects all <a> elements with the className "last". Since you don't have any of these, the CSS does nothing to your page.

You need this instead:

Code: Select all
 
#navigation ul li.last a {
   border-right: none;
}
Thank you! That did it. Any idea what property I need to edit to move the navigation div a few pixels to the left? It seems I've tried everything. (When I made the float property of the #navigation ul li to "right," everything flushed to the right side of the table cell. I need to nudge the navigation items to the left a bit.)

The relevant code looks like this:

Code: Select all
   
...
 
<tr class="navbackground">
   <td height="24" colspan="2" background="images/global/index_03.gif" class="nav">
 
<div id="navigation">
   <ul>
      <li class="last"><a href="contact.html">Contact</a></li>
      <li><a href="thearts.html">The Arts</a></li>    
      (etc...)
   </ul>
</div>
 
   </td>
</tr>
As you can see, the background image and navigation div are both within a single table row.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #9  
Old Sep 11th, 2007, 23:31
Most Reputable Member
Join Date: May 2007
Location: UK
Age: 27
Posts: 1,111
Thanks: 0
Thanked 0 Times in 0 Posts
Re: Positioning Spry Menu Bar, etc.

For a start, you'd better check your HTML is valid. I have no idea whether <div>s are allowed inside <table>s (I never use <table> for layout). It seems rather an odd thing to do.

To move #navigation a few pixels left, try:
Code: Select all
#navigation {
margin-left: -5px;
}
Or:

Code: Select all
#navigation {
padding-right: 5px;
}
Or if you're desperate, the slightly hacky:

Code: Select all
#navigation {
position: relative;
left: -5px;
}
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
Reply

Tags
spry menu, positioning, height

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
Positioning problems with horizontal drop down menu dreamabstract Web Page Design 2 Jun 16th, 2008 13:09
Spry works in FF - not in IE overkil6 JavaScript Forum 1 Apr 15th, 2008 16:58
[SOLVED] Spry password confirmation widget in DW CS3 grandadbob Scripts and Online Services 5 Nov 30th, 2007 19:34
Spry Menu Bar, Adding Submenu Border and Submenu semi-Transparent background ravennaweb Web Page Design 2 Sep 24th, 2007 15:27
menu / layout positioning issue in IE Pixelate Web Page Design 2 May 9th, 2006 14:15


All times are GMT. The time now is 01:32.


Powered by vBulletin®
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.2.0 RC8
© 2003-2008 Webforumz.com : All Rights Reserved