|
|
|
|
Bonjour à tous,
Je rencontre un problème avec un code css.
J'essaie de créer un menu déroulant vertical, mais pour le moment mon menu présente un espace(comme ci dessous) quand je survole les menus <dt>
>-----------------------------------<
Menu 1 >>
...............Lien 1
...............Lien 2
...............Lien 3
Menu 2
Menu 3
>-----------------------------------<
Et donc je souhaite que ce drôle d'espace disparaisse, et que les sous menu (qui se sont déroulés) soit porté bien sur le droite du menu, pas en dessous, comme ça :
>-----------------------------------<
Menu 1 >> Lien 1
Menu 2......Lien 2
Menu 3......Lien 3
>-----------------------------------<
Je comprendrais que cela ne vous parle pas trop, est-ce qu'un screen de mon problème vous aiderait plus à comprend ?
>> état actuel en image (survol du menu 1) :
http://i82.servimg.com/u/f82/12/22/58/47/sans_t10.jpg
voici mon code css de mon menu déroulant:
<------------------------------------------------------------>
div#wrapper div#sidebar ul {
display:block;
padding: 0;
width: 147px;
margin:0px;
}
div#wrapper div#sidebar dl dd {
display:none;
}
div#wrapper div#sidebar ul li {
position:relative;
list-style: none;
}
div#wrapper div#sidebar ul ul{
position: absolute;
top: 0;
left: 100px;
}
div#wrapper div#sidebar dl:hover dd {
display:block;
}
div#wrapper div#sidebar a:hover {
background: transparent url(images/design/sidebar_link_over.gif) no-repeat left top;
color: #7baded;
}
<------------------------------------------------------------>
ne faites pas attention à "div#wrapper div#sidebar"... ce sont des divisions précédentes de mes pages
Configuration: Windows Vista Firefox 3.0.7
J'ai essaiyé ce que tu me conseil à l'instant : je n'est pas de changement.
|
J'ai trouvé une piste sur ce site :
|
Salut
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>RAD ZONE Webcreation</title>
<meta name="author" content="http://radservebeer.free.fr" />
<meta name="generator" content="PSPad editor, www.pspad.com" />
<style type="text/css">
/*<![CDATA[*/
.menu {
margin: 10px;
height: 100px;
font-size: 10pt;
font-family: verdana;
}
.menu ul {
margin: 0pt;
padding: 0pt;
position: relative;
z-index: 500;
list-style-type: none;
width: 11em;
}
.menu li {
background-color: #cccc99;
float: left;
}
.menu li.sub {
background-color: #cccc99;
}
.menu table {
position: absolute;
border-collapse: collapse;
top: 0pt;
left: 0pt;
z-index: 100;
font-size: 1em;
margin-top: -1px;
}
.menu a, .menu a:visited {
border: 1px solid #ffffff;
display: block;
text-decoration: none;
height: 2em;
line-height: 2em;
width: 11em;
color: #000000;
padding-left: 1em;
font-weight: normal;
font-style: normal;
font-variant: normal;
text-transform: none;
}
.menu b {
float: right;
margin-right: 5px;
}
* html .menu a, * html .menu a:visited {
width: 11em;
}
* html .menu a:hover {
color: #ccff66;
background-color: #999966;
position: relative;
font-weight: normal;
font-style: normal;
font-variant: normal;
text-decoration: none;
text-transform: none;
}
.menu li:hover {
position: relative;
}
.menu a:active, .menu a:focus {
color: #ccff66;
background-color: #999966;
font-weight: normal;
font-style: normal;
font-variant: normal;
text-decoration: none;
text-transform: none;
}
.menu li:hover > a {
color: #ccff66;
background-color: #999966;
font-weight: normal;
font-style: normal;
font-variant: normal;
text-decoration: none;
text-transform: none;
}
.menu li ul {
padding: 2em;
visibility: hidden;
position: absolute;
top: -2em;
left: 7em;
background-color: transparent;
}
.menu li:hover > ul {
visibility: visible;
}
.menu ul a:hover ul ul {
visibility: hidden;
}
.menu ul a:hover ul a:hover ul ul {
visibility: hidden;
}
.menu ul a:hover ul a:hover ul a:hover ul ul {
visibility: hidden;
}
.menu ul a:hover ul {
visibility: visible;
}
.menu ul a:hover ul a:hover ul {
visibility: visible;
}
.menu ul a:hover ul a:hover ul a:hover ul {
visibility: visible;
}
.menu ul a:hover ul a:hover ul a:hover ul a:hover ul {
visibility: visible;
}
/*]]>*/
</style>
</head>
<body>
<div class="menu">
<ul><li>
<a href="#"><b>»</b>Menu 1
<!--[if IE 7]>
<!--></a>
<!--<![endif]-->
<!--[if lte IE 6]>
<table>
<tr>
<td>
<![endif]-->
<ul><li>
<a href="#">Sub Menu 1a</a></li><li>
<a href="#">Sub Menu 1b</a></li>
</ul>
<!--[if lte IE 6]>
</td>
</tr>
</table>
</a>
<![endif]--></li><li>
<a href="#"><b>»</b>Menu 2
<!--[if IE 7]>
<!--></a>
<!--<![endif]-->
<!--[if lte IE 6]>
<table>
<tr>
<td>
<![endif]-->
<ul><li>
<a href="#">Sub Menu 2a</a></li><li>
<a href="#"><b>»</b>Sub Menu 2b
<!--[if IE 7]>
<!--></a>
<!--<![endif]-->
<!--[if lte IE 6]>
<table>
<tr>
<td>
<![endif]-->
<ul><li>
<a href="#"><b>»</b>Sub sub Menu 2b
<!--[if IE 7]>
<!--></a>
<!--<![endif]-->
<!--[if lte IE 6]>
<table>
<tr>
<td>
<![endif]-->
<ul><li>
<a href="#">Sub Menu 2ba</a></li>
</ul>
<!--[if lte IE 6]>
</td>
</tr>
</table>
</a>
<![endif]--></li>
</ul>
<!--[if lte IE 6]>
</td>
</tr>
</table>
</a>
<![endif]--></li><li>
<a href="#">Sub Menu 2Bb</a></li>
</ul>
<!--[if lte IE 6]>
</td>
</tr>
</table>
</a>
<![endif]--></li><li>
<a href="#">Menu 3</a></li><li>
<a href="#">Menu 4</a></li>
</ul>
</div>
</body>
</html>
♣ La plus grande erreur que puisse faire un homme est d'avoir peur d'en faire une. ♣ |
Oups. ya un nouveau problème :S
|
Il faut bien placer la balise de fermeture du h1 dans le code !
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>RAD ZONE Webcreation</title>
<meta name="author" content="http://radservebeer.free.fr" />
<meta name="generator" content="PSPad editor, www.pspad.com" />
<style type="text/css" >
/*<![CDATA[*/
.menu {
margin: 10px;
height: 100px;
font-size: 10pt;
font-family: verdana;
}
.menu ul {
margin: 0pt;
padding: 0pt;
position: relative;
z-index: 500;
list-style-type: none;
width: 11em;
}
.menu li {
background-color: #cccc99;
float: left;
}
.menu li.sub {
background-color: #cccc99;
}
.menu table {
position: absolute;
border-collapse: collapse;
top: 0pt;
left: 0pt;
z-index: 100;
font-size: 1em;
margin-top: -1px;
}
.menu a, .menu a:visited {
border: 1px solid #ffffff;
display: block;
text-decoration: none;
height: 2em;
line-height: 2em;
width: 11em;
color: #000000;
padding-left: 1em;
font-weight: normal;
font-style: normal;
font-variant: normal;
text-transform: none;
}
.menu b {
float: right;
margin-right: 5px;
}
* html .menu a, * html .menu a:visited {
width: 11em;
}
* html .menu a:hover {
color: #ccff66;
background-color: #999966;
position: relative;
font-weight: normal;
font-style: normal;
font-variant: normal;
text-decoration: none;
text-transform: none;
}
.menu li:hover {
position: relative;
}
.menu a:active, .menu a:focus {
color: #ccff66;
background-color: #999966;
font-weight: normal;
font-style: normal;
font-variant: normal;
text-decoration: none;
text-transform: none;
}
.menu li:hover > a {
color: #ccff66;
background-color: #999966;
font-weight: normal;
font-style: normal;
font-variant: normal;
text-decoration: none;
text-transform: none;
}
.menu li ul {
padding: 2em;
visibility: hidden;
position: absolute;
top: -2em;
left: 7em;
background-color: transparent;
}
.menu li:hover > ul {
visibility: visible;
}
.menu ul a:hover ul ul {
visibility: hidden;
}
.menu ul a:hover ul a:hover ul ul {
visibility: hidden;
}
.menu ul a:hover ul a:hover ul a:hover ul ul {
visibility: hidden;
}
.menu ul a:hover ul {
visibility: visible;
}
.menu ul a:hover ul a:hover ul {
visibility: visible;
}
.menu ul a:hover ul a:hover ul a:hover ul {
visibility: visible;
}
.menu ul a:hover ul a:hover ul a:hover ul a:hover ul {
visibility: visible;
}
h1{
font-size: 10pt;
float: left;
margin: 0px;
}
/*]]>*/
</style>
</head>
<body>
<div class="menu">
<ul><li>
<h1><a href="#"><b>»</b>Menu 1
<!--[if IE 7]>
<!--></a> </h1>
<!--<![endif]-->
<!--[if lte IE 6]>
<table>
<tr>
<td>
<![endif]-->
<ul><li>
<a href="#">Sub Menu 1a</a></li><li>
<a href="#">Sub Menu 1b</a></li>
</ul>
<!--[if lte IE 6]>
</td>
</tr>
</table>
</a>
<![endif]--></li><li>
<h1> <a href="#"><b>»</b>Menu 2
<!--[if IE 7]>
<!--></a> </h1>
<!--<![endif]-->
<!--[if lte IE 6]>
<table>
<tr>
<td>
<![endif]-->
<ul><li>
<a href="#">Sub Menu 2a</a></li><li>
<a href="#"><b>»</b>Sub Menu 2b
<!--[if IE 7]>
<!--></a>
<!--<![endif]-->
<!--[if lte IE 6]>
<table>
<tr>
<td>
<![endif]-->
<ul><li>
<a href="#"><b>»</b>Sub sub Menu 2b
<!--[if IE 7]>
<!--></a>
<!--<![endif]-->
<!--[if lte IE 6]>
<table>
<tr>
<td>
<![endif]-->
<ul><li>
<a href="#">Sub Menu 2ba</a></li>
</ul>
<!--[if lte IE 6]>
</td>
</tr>
</table>
</a>
<![endif]--></li>
</ul>
<!--[if lte IE 6]>
</td>
</tr>
</table>
</a>
<![endif]--></li><li>
<a href="#">Sub Menu 2Bb</a></li>
</ul>
<!--[if lte IE 6]>
</td>
</tr>
</table>
</a>
<![endif]--></li><li>
<h1><a href="#">Menu 3</a></h1> </li><li>
<h1><a href="#">Menu 4</a></h1> </li>
</ul>
</div>
</body>
</html>
♣ La plus grande erreur que puisse faire un homme est d'avoir peur d'en faire une. ♣ |
Désolé de vous embêter ^^'
|
REGARDE C EST LE COPIE COLLE
|
Oui oui, tout seul ça fonctionne bien :
|
De retour de bbq :-))
.menu {
height: 21px;
line-height: 21px;
list-style-type: none;
}
met ca a la place ! .menu {
height: 100px;
list-style-type: none;
}
et pour le swf header met ce code a la place du tient c est beaucoup mieux pour inserer des swf ! <object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" width="935" height="450" id="flash">
<param name="movie" value="images/header/header.swf" />
<param name="quality" value="high" />
<!--[if !IE]>-->
<object type="application/x-shockwave-flash" data="images/header/header.swf" width="935" height="450">
<param name="quality" value="high" />
<!--<![endif]-->
<a href="http://www.adobe.com/go/getflashplayer">
<img src="http://www.adobe.com/images/shared/download_buttons/get_flash_player.gif" alt="Get Adobe Flash player" /></a>
<!--[if !IE]>-->
</object>
<!--<![endif]-->
</object>
A+ ♣ La plus grande erreur que puisse faire un homme est d'avoir peur d'en faire une. ♣ |
Oh que je suis bête mon dieu !
|
Dans le CSS tu rajoute un <ul class="sub"><li>
<a href="#">Sub Menu 1a</a></li><li>
<a href="#">Sub Menu 1b</a></li>
</ul>
A+ ♣ La plus grande erreur que puisse faire un homme est d'avoir peur d'en faire une. ♣ |