CSS Horizontal drop-down menu ???

This is a discussion on "CSS Horizontal drop-down menu ???" within the Web Page Design section. This forum, and the thread "CSS Horizontal drop-down menu ??? are both part of the Design Your Website category.



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

Notices


Reply
 
LinkBack Thread Tools
  #1 (permalink)  
Old Apr 6th, 2006, 15:52
Junior Member
Join Date: Apr 2006
Age: 27
Posts: 29
Thanks: 0
Thanked 0 Times in 0 Posts
Question CSS Horizontal drop-down menu ???

I wonder if anyone around could possibly help me ease up my stress that I've been having for the past 2 days in sorting out the CSS Horizontal drop-down menu.

I've somehow managed to get the Vertical Pop-up menu along with its submenus ("leftMenu" in my code) but the Horizontal drop-down menu ("topMenu" in my code) seems to be proving a real pain in the neck.

I want it EXACTLY same as it can be seen in this website:

http://www.phoenity.com/newtedge/horizontal_nav/ ("Inline" version). I tried coping & paste the code, but sadly all in vain, since the problem I encounter is to "fit" it in the space for "topMenu" (red bordered-line area).

This website shows the use of <table> however, I'm not quite comfortable using it, since I didn't use it to create my left menu, so would like my top menu to be made more or less with the same sort of coding as the left Menu.

ANY HELP WOULD BE GREATLY APPRECIATED since I couldn't possibly go further without getting myself out of this misery first.

The result I've achieved so far is seen in the attached file.

Following are the codes from my 2 files i.e. style.css & home.html

STYLE.CSS

/* CSS Document */

Code: Select all
 <style type="text/css">

/* Div */

div
{
    text-align:center;
}


/* ......................... Banner ........................ */

div.banner{width:100%; height:4em; background:url('glass_row.jpg');}


/* ......................... Top Menu ........................ */

#topMenu
{
    border:1px solid red;
    background-color:transparent;
    width:90%; 
    height:30px;  
    float:right;
}

#topMenu ul
{
    list-style-type: none;
    display: inline;
}

#topMenu ul li 
{
    display: inline;
    position: relative;
}

#topMenu ul a
{
    color: blue;
    font-weight:bold;
    text-decoration: none;
    display: inline;
}

#topMenu ul a:hover 
{
    position:inherit;
    color:white;
    text-decoration:none;
    background-color:#0000FF;
}


#topMenu ul li ul 
{
    list-style: none;
    position: absolute;
    left: 60px;
    top: 0;
    display: none;
    width: 125px;
}

#topMenu ul li:hover ul {display: block;}

body { behavior: url(csshover.htc); }

/* NOT USING CURRENTLY 

a.topMenu:link{color:#000000;}
a.topMenu:visited{color:black;}
a.topMenu:hover{background-color:#FF0000;}
*/

/* ......................... Left Menu ........................ */

#leftMenu
{
background-color:transparent;
text-align:center;
width:10%;
height:20em; 
float:left;
}

/* Code for Left Menu itself */

#leftMenu ul
{
display:block;
width:80px;
margin:10px 10px 10px 10px;
padding:0;
font-weight:bold;
list-style:none;
}

#leftMenu ul a
{
    color: #FFF;
    text-decoration: none;
    display: block;
    padding: 5px 5px 5px 10px;
    width: 60px;
    background: #333;
}

#leftMenu ul a:hover 
{
    color: #4BD8FF;
    text-decoration: none;
    background: #3C3C3C;
}

#leftMenu ul li 
{
    border-bottom: 1px solid #FFF;
    float: left;
    position: relative;
}

#leftMenu ul li ul 
{
    list-style: none;
    position: absolute;
    left: 60px;
    top: 0;
    display: none;
    width: 125px;
    border-left: 1px solid #FFF;
}

#leftMenu ul li:hover ul li ul { display: none; }
#leftMenu ul li:hover ul { display: block; }

body { behavior: url(csshover.htc); }


/* Fix IE. Hide from IE Mac \*/
* html #leftMenu ul li {float:left; height:1%;}
* html #leftMenu ul li a {height:1%;}
/* End */

a.leftMenu:link{color:#000000;}
a.leftMenu:visited{color:black;}
a.leftMenu:hover{background-color:#FF0000;}


/* ......................... Content ............................ */

div.content
{
background-color:yellow; 
width:90%; 
height:25em; 
float:right;
}

/* ......................... Bottom Menu ............................ */


div.bottomMenu
{
background-color:green; 
width:100%; 
float:left;
height:5%; 
}


/* Anchor */

/*
a:link {color:#FF0000; text-decoration:none}
a:visited {color:#FF00FF}
a:hover {color:#FFFF00; font-size: monospace}
a:active {color:#00FFFF}
*/

/* Paragraph */

p 
{
font-family:Verdana, Arial, Helvetica, sans-serif;
font-size:medium;
font-weight:normal;
color:#0000FF;
}

/* Headings */

h1
{
font-family:Georgia, "Times New Roman", Times, serif;
font-weight:bold;
color:#FF0000;
text-decoration:underline
}

/* Pseudo elements */

p.firstLetter:first-letter {color:#33CC00; font-size:150%}
p.firstLine:first-line {color:#00FF00}


HOME.HTML

Code: Select all
 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"/>
<title>Alcohol - Main Page</title>
<link rel="stylesheet" type="text/css" href="style.css"/>
<style type="text/css">
</style>
</head>

<body background="background_champagne.gif">

<div class="banner">
</div>

<div id="topMenu">
  <ul>
<li><a href="">Beer</a>
    <ul>
      <li>Sub Menu 1</li>
      <li>Sub Menu 2</li>
      <li>Sub Menu 3</li>
    </ul>
</li>
<li><a href="">Wine</a>
    <ul>
      <li>Sub Menu 1</li>
      <li>Sub Menu 2</li>
      <li>Sub Menu 3</li>
    </ul>
</li>
<li><a href="">Whiskey</a>
    <ul>
      <li>Sub Menu 1</li>
      <li>Sub Menu 2</li>
      <li>Sub Menu 3</li>
    </ul>
</li>
<li><a href="">Spirit</a>
    <ul>
      <li>Sub Menu 1</li>
      <li>Sub Menu 2</li>
      <li>Sub Menu 3</li>
    </ul>
</li>
  </ul>
</div>

<div id="leftMenu">
  <ul>
<li><a href="">Beer</a>
    <ul>
      <li>Sub Menu 1</li>
      <li>Sub Menu 2</li>
      <li>Sub Menu 3</li>
    </ul>
</li>
<li><a href="">Wine</a>
    <ul>
      <li>Sub Menu 1</li>
      <li>Sub Menu 2</li>
      <li>Sub Menu 3</li>
    </ul>
</li>
<li><a href="">Whiskey</a>
    <ul>
      <li>Sub Menu 1</li>
      <li>Sub Menu 2</li>
      <li>Sub Menu 3</li>
    </ul>
</li>
<li><a href="">Beer</a>
    <ul>
      <li>Sub Menu 1</li>
      <li>Sub Menu 2</li>
      <li>Sub Menu 3</li>
    </ul>
</li>
  </ul>
</div>

<div class="content">
Content
</div>

<div class="bottomMenu">
Bottom Menu
</div>
Attached Images
File Type: jpg result.jpg (42.3 KB, 1422 views)

Last edited by j4mes_bond25; Apr 6th, 2006 at 16:13.
Reply With Quote

  #2 (permalink)  
Old Apr 6th, 2006, 16:04
benbacardi's Avatar
Highly Reputable Member
Join Date: Feb 2004
Location: United Kingdom
Age: 20
Posts: 611
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to benbacardi Send a message via Skype™ to benbacardi
Re: CSS Horizontal drop-down menu ???

style.css needs NO html tags within it... none at all... remove the

<html>
<head>
<style type="text/css">

from the top and the

</style>
</head>

<body>

from the middle, and the

</body>
</html>
from the bottom.

Also please could you contain your code within code tags next time. Thanks
Reply With Quote
  #3 (permalink)  
Old Apr 6th, 2006, 16:10
Junior Member
Join Date: Apr 2006
Age: 27
Posts: 29
Thanks: 0
Thanked 0 Times in 0 Posts
Re: CSS Horizontal drop-down menu ???

Quote:
Originally Posted by benbacardi
style.css needs NO html tags within it... none at all... remove the

<html>
<head>
<style type="text/css">

from the top and the

</style>
</head>

<body>

from the middle, and the

</body>
</html>
from the bottom.

Also please could you contain your code within code tags next time. Thanks
Thanks for enlightening me but as you can imagine being rather new to this forum, I wasn't quite aware of it but I'll try editing my previous post & see if it works.
Reply With Quote
Reply

Tags
css, horizontal, dropdown, menu

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 12:09
Horizontal drop down in table cell gribble JavaScript Forum 1 Mar 5th, 2007 20:31
Making A CSS horizontal, drop down menu Powderhound Web Page Design 15 Aug 22nd, 2006 10:42
horizontal drop-down menu da_stimulator JavaScript Forum 2 Nov 4th, 2004 11:16
Horizontal drop down list Ranko Web Page Design 8 Oct 23rd, 2004 10:25


All times are GMT. The time now is 16:11.


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

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43