[solved?]Menu too much space
Posted: Thu Aug 21, 2008 3:22 am
Hi,
Could someone could help me? I changed so many times my CSS since days that I am unable to find good version of it.
In IE, the top menu is completly decaled from its desired position (juste sitting on top of banner). In FF, it's almost fine, except a disgracious space under it.
http://www.labneuro.hostwq.net
Edit: I change to absolute position for menu, and now it's works. I don't know if floating or absolute is better, but in that case, at least its quite better like this.
Could someone could help me? I changed so many times my CSS since days that I am unable to find good version of it.
In IE, the top menu is completly decaled from its desired position (juste sitting on top of banner). In FF, it's almost fine, except a disgracious space under it.
http://www.labneuro.hostwq.net
Code: Select all
<div id="header">
<div id="sitename">
<h1>{cms_selflink dir="start" text="$sitename"}</h1>
</div>
<div id="lang">
<p>{lang text="true" class="lang" spacer=" - "}</p>
</div>
{* Start Navigation *}
<div id="menu">{menu template='dropdown' start_element='8' show_root_siblings="1"} {* End Navigation *}</div>
</div>
<div id="splash"><a href="#"><img title="Labo d'hépato-neurologie" src="uploads/images/logo/banniere.gif" alt="Labo d'hépato-neurologie" width="490" height="140" /></a>
<div id="logo"><a href="http://www.umontreal.ca"> <img class="logo_top" src="uploads/images/logo/UdeM_Blanc_petit.gif" alt="Université de Montréal" width="103" height="40" /></a> <a href="http://www.chumtl.qc.ca/"><img class="logo_bot" src="uploads/images/logo/chum_c_petit.gif" alt="Centre Hospitalier de l'Université de Montréal" width="47" height="40" /></a></div>
</div>Code: Select all
/* Header */
#header {
width: 100%;
margin: 0;
height: 50px;
}
/* Logo */
#sitename {
float: left;
margin: 0 0.5em;
}
#sitename h1 {
font-size: 1em;
}
#sitename a {
text-decoration: none;
color: #000000;
}
/* Lang */
#lang {
clear: both;
float: left;
text-decoration: none;
text-transform: uppercase;
font-size: .8em;
font-weight: bold;
margin: 0em 0em 0 0.5em;
}
/* Splash */
#splash {
height: 140px;
margin: 0;
width: 100%;
}
#splash img {
float: left;
}
#logo img {
float: right;
margin: 2%;
}
#menu {
float: right;
margin: 0;
background: #dbdbdb;
height: 20px;
border-top: 8px solid #FFFFFF;
}
#menu a:hover {
color: #B20000;
}
/* The wrapper clears the floating elements of the menu */
/* Fix for Opera 8 */
.clearb { clear: both; }
#menuwrapper {
/* Fix for Opera 8 */
/* overflow: hidden; */
background-color: #ECECEC;
border-bottom: 1px solid #C0C0C0;
width: 100%;
}
/* Set the width of the menu elements at second level. Leaving first level flexible. */
#primary-nav li li {
width: 100px;
}
/* Unless you know what you do, do not touch this */
#primary-nav, #primary-nav ul {
list-style: none;
margin: 0px;
padding: 0px;
}
#primary-nav ul {
position: absolute;
top: auto;
display: none;
}
#primary-nav ul ul {
margin-top: 1px;
margin-left: -1px;
left: 100%;
top: 0px;
}
#primary-nav li {
margin-left: -1px;
float: left;
}
#primary-nav li li {
margin-left: 0px;
margin-top: -1px;
float: none;
position: relative;
}
/* Styling the basic apperance of the menu elements */
#primary-nav a {
padding: 0.35em 1.2em 0 1.2em;
text-decoration: none;
text-transform: uppercase;
font-size: .8em;
font-weight: bold;
color: #000000;
display: block;
margin: 0px;
}
#primary-nav li a {
border-left: 1px solid #C0C0C0;
}
#primary-nav li li a {
border: 1px solid #C0C0C0;
}Edit: I change to absolute position for menu, and now it's works. I don't know if floating or absolute is better, but in that case, at least its quite better like this.