Welcome to Dream.In.Code
Getting Help is Easy!

Join 107,663 Programmers for FREE! Ask your question and get quick answers from experts. There are 1,013 online right now! We've got more than 500 tutorials and 2,000 snippets. Join and find out why Dream.In.Code is the #1 programming help community on the internet! Registration is fast and FREE... Join Now!



HTML/CSS Menu Positioning Issue

 
Reply to this topicStart new topic

HTML/CSS Menu Positioning Issue, I need it to remain in the same location

jjsaw5
post 18 Jun, 2008 - 07:14 PM
Post #1


D.I.C. Face

Group Icon
Joined: 4 Jan, 2008
Posts: 937



Thanked 5 times

Dream Kudos: 125
My Contributions


I'm having a bit of trouble with a vertical menu.

The two issues I am having are as follows...
1. I need the menu to stay in the same place on all the different pages
2. I created the menu as a separate file and tired to use the include statement on the pages i wanted the menu to show up. Didn't work.

I'm hoping that you guys will be able to take a look at it and help me out.

I'll post the html and css code and give you a link to the site.

CSS
CODE
.glossymenu, .glossymenu li ul{
list-style-type: none;
margin: 0;
padding: 0;
width: 160px; /*WIDTH OF MAIN MENU ITEMS*/
border: 1px solid black;
}

.glossymenu li{
position: relative;
}

.glossymenu li a{
background: white url(glossyback.gif) repeat-x bottom left;
font: bold 12px Verdana, Helvetica, sans-serif;
color: white;
display: block;
width: auto;
padding: 5px 0;
padding-left: 10px;
text-decoration: none;
}

.glossymenu li ul{ /*SUB MENU STYLE*/
position: absolute;
width: 190px; /*WIDTH OF SUB MENU ITEMS*/
left: 0;
top: 50;
display: none;
}

.glossymenu li ul li{
float: left;
}

.glossymenu li ul a{
width: 180px; /*WIDTH OF SUB MENU ITEMS - 10px padding-left for A elements */
}

.glossymenu .arrowdiv{
position: absolute;
right: 2px;
background: transparent url(arrow.gif) no-repeat center right;
}

.glossymenu li a:visited, .glossymenu li a:active{
color: white;
}

.glossymenu li a:hover{
background-image: url(glossyback2.gif);
}

/* Holly Hack for IE \*/
* html .glossymenu li { float: left; height: 1%; }
* html .glossymenu li a { height: 1%; }
/* End */





and here is the html, currently have have the menu hard coded on each page i would like to just use the include statement.

CODE
<html>
<head>

<link rel="stylesheet" href="jenn.css" type="text/css">
<link rel="stylesheet" type="text/css" href="cssverticalmenu.css" />
<script type="text/javascript" src="cssverticalmenu.js">
/***********************************************

* CSS Vertical List Menu- by JavaScript Kit (www.javascriptkit.com)
* Menu interface credits: http://www.dynamicdrive.com/style/csslibrary/item/glossy-vertical-menu/
* This notice must stay intact for usage
* Visit JavaScript Kit at http://www.javascriptkit.com/ for this script and 100s more

***********************************************/
</script>



</head>
<body>
<ul id="verticalmenu" class="glossymenu">
<li><a href="index.html">Home</a></li>
<li><a href="bio.html">Jen's Bio</a></li>
<li><a href="photo.html">Jen's Art Work</a></li>
<li><a href="form.html">Place An Order</a>
<li><a href="" >Friends Pages</a></li>
</ul>



<p align="center">This page is under construction</p>






</body>
</html>




Thanks for taking a look at it.
www.jrockage.com
User is offlineProfile CardPM

Go to the top of the page


BetaWar
post 18 Jun, 2008 - 07:35 PM
Post #2


#include <soul.h>

Group Icon
Joined: 7 Sep, 2006
Posts: 1,120



Thanked 38 times

Dream Kudos: 725
My Contributions


Okay, I noticed that depending on which page you are viewing the menu does move around quite a bit. This is because of the banner (or lack of) on some pages. On th emain page the banner is probably about 200 px tall, on the other pages it is smaler (causing verticle movement).

The photo paeg has it inline with the rest of the stuff, and I think (am not sure as I haven't played around with it yet) that it amy be becuase you are telling it to be in a table cell, without habing a table anywhere around the menu

current code:
CODE
<TD ALIGN = "left">


<ul id="verticalmenu" class="glossymenu">
<li><a href="index.html">Home</a></li>
<li><a href="bio.html">Jenn's Bio</a></li>
<li><a href="photo.html">Jenn's Art Work</a></li>
<li><a href="">Greeting Cards</a></li>
<li><a href="#">Place An Order</a>
    <ul>
    <li><a href="">Art Work</a></li>
    <li><a href="">Cards</a></li>
    <li><a href="">Custom</a></li>
    </ul>
</li>
<li><a href="" >Friends Pages</a></li>
</ul>
</TD>


I would try to change it to this:
CODE
<ul id="verticalmenu" class="glossymenu">
<li><a href="index.html">Home</a></li>
<li><a href="bio.html">Jenn's Bio</a></li>
<li><a href="photo.html">Jenn's Art Work</a></li>
<li><a href="">Greeting Cards</a></li>
<li><a href="#">Place An Order</a>
    <ul>
    <li><a href="">Art Work</a></li>
    <li><a href="">Cards</a></li>
    <li><a href="">Custom</a></li>
    </ul>
</li>
<li><a href="" >Friends Pages</a></li>
</ul>


and see if ti works out any better.

If that isn't the solution to the problem with the photos page let me know and I will dive into the problem more whole-heartedly.
User is offlineProfile CardPM

Go to the top of the page

jjsaw5
post 18 Jun, 2008 - 08:09 PM
Post #3


D.I.C. Face

Group Icon
Joined: 4 Jan, 2008
Posts: 937



Thanked 5 times

Dream Kudos: 125
My Contributions


I changed it and unfortunately it didn't work. I think i need to establish some sort of layout for the page. This is my 1st time making a site on my own so i am learning as i go
User is offlineProfile CardPM

Go to the top of the page

BetaWar
post 18 Jun, 2008 - 09:59 PM
Post #4


#include <soul.h>

Group Icon
Joined: 7 Sep, 2006
Posts: 1,120



Thanked 38 times

Dream Kudos: 725
My Contributions


If it is your first time then I would suggest using tables (while many hardcore html programmers frown at the use of tables in making a layout it is far easier to get things looking, and staying where they are supposed to be). Here is a basic 2 column site layout:

CODE
<table cellpadding="0" cellspacing="0" style="width: 100%">
<rd>
<td colspan="2">
Banner goes here
</td>
</tr>
<tr>
<td width="150">
Menu goes here
</td>
<td>
Content goes here
</td>
</tr>
<tr>
<td colspan="2">
Copyright information
</td>
</tr>
</table>


I know it doesn't use any style sheets, but it is just a very basic thing thatyou can use as a template. Basically the table will take up the whole page width then the menu will only use 150px of the page width making the rest of the room space for content.
The top and bottom table rows are set to be one cell taking up the whole width making them nice places to put the banner and copyright information.

I have started looking to see if I can locate a solution in the css for your initial problem, but it may take some time to get figured out.
User is offlineProfile CardPM

Go to the top of the page

Fast ReplyReply to this topicStart new topic
Time is now: 8/29/08 10:22PM

Live Help!

Tutorials

Programming

Web Development

Reference Sheets

Code Snippets

Bye Bye Ads

Free DIC T-Shirt

T-Shirt Example

Related Sites

Monthly Drawing

Thumb Drive

Partners

Top Contributors

Top 10 Kudos This Month