28173 sujets

CSS et mise en forme, CSS3

Bonjour,

Je chercherais à savoir comment inserer votre menu horzontal à cette page: http://css.alsacreations.com/xmedia/exemples/deroulant/menu-horizontal.htm dans une cellule d'un tableau ?

Voici mon code:
<html>

<head>
<meta http-equiv="Content-Language" content="fr">
<meta name="GENERATOR" content="Microsoft FrontPage 6.0">
<meta name="ProgId" content="FrontPage.Editor.Document">
<meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
<title>New Page 1</title>
</head>
<script type="text/javascript">
<!--
window.onload=montre;
function montre(id) {
var d = document.getElementById(id);
	for (var i = 1; i<=10; i++) {
		if (document.getElementById('smenu'+i)) {document.getElementById('smenu'+i).style.display='none';}
	}
if (d) {d.style.display='block';}
}
//-->
</script>


<style type="text/css">
<!-- 
/* CSS issu des tutoriels  http://css.alsacreations.com  */
body {
margin: 0;
padding: 0;
background: white;
font: 80% verdana, arial, sans-serif;
}
dl, dt, dd, ul, li {
margin: 0;
padding: 0;
list-style-type: none;
}
#menu {
position: absolute;
top: 0;
left: 0;
z-index:100;
width: 100%;
}
#menu dl {
float: left;
width: 12em;
margin: 0 1px;
}
#menu dt {
cursor: pointer;
text-align: center;
font-weight: bold;
background: #ccc;
border: 1px solid gray;
}
#menu dd {
border: 1px solid gray;
}
#menu li {
text-align: center;
background: #fff;
}
#menu li a, #menu dt a {
color: #000;
text-decoration: none;
display: block;
height: 100%;
border: 0 none;
}
#menu li a:hover, #menu dt a:hover {
background: #eee;
}

#site {
position: absolute;
z-index: 1;
top : 70px;
left : 10px;
color: #000;
background-color: #ddd;
padding: 5px;
border: 1px solid gray; 
}

-->
</style>
<body>
<div id="menu">
	<dl>
		<dt onmouseover="javascript:montre();"><a href="" title="Retour à l'accueil">Accueil</a></dt>
	</dl>
	
	<dl>			
		<dt onmouseover="javascript:montre('smenu1');">Menu 1</dt>
			<dd id="smenu1">
				<ul>
					<li><a href="#">Sous-Menu 1.1</a></li>

					<li><a href="#">Sous-Menu 1.2</a></li>
					<li><a href="#">Sous-Menu 1.3</a></li>
					<li><a href="#">Sous-Menu 1.4</a></li>
					<li><a href="#">Sous-Menu 1.5</a></li>
					<li><a href="#">Sous-Menu 1.6</a></li>
				</ul>

			</dd>
	</dl>
	
	
	<dl>	
		<dt onmouseover="javascript:montre('smenu2');">Menu 2</dt>
			<dd id="smenu2">
				<ul>
					<li><a href="#">Sous-Menu 2.1</a></li>
					<li><a href="#">Sous-Menu 2.2</a></li>

					<li><a href="#">Sous-Menu 2.3</a></li>
					<li><a href="#">Sous-Menu 2.4</a></li>
				</ul>
			</dd>
	</dl>
	
	<dl>	
		<dt onmouseover="javascript:montre('smenu3');">Menu 3</dt>
			<dd id="smenu3">

				<ul>
					<li><a href="#">Sous-Menu 3.1</a></li>
					<li><a href="#">Sous-Menu 3.2</a></li>
					<li><a href="#">Sous-Menu 3.3</a></li>
					<li><a href="#">Sous-Menu 3.4</a></li>
					<li><a href="#">Sous-Menu 3.5</a></li>

				</ul>
			</dd>
	</dl>
	
	<dl>	
		<dt onmouseover="javascript:montre('smenu4');">Menu 4</dt>
			<dd id="smenu4">
				<ul>
					<li><a href="#">Sous-Menu 4.1</a></li>

					<li><a href="#">Sous-Menu 4.2</a></li>
					<li><a href="#">Sous-Menu 4.3</a></li>
				</ul>
			</dd>
	</dl>
	
</div>
<div align="center">
	<table border="0" style="border-collapse: collapse; border: 1px solid #004773; padding: 0" width="750" cellpadding="0" id="table1">
		<tr>
			<td width="200" rowspan="3">
			<p style="margin-top: 0; margin-bottom: 0"><font face="Verdana">
			<img border="0" src="medias/vip/logo.jpg" width="200" height="150"></font></td>
			<td width="550" height="90">
			<p style="margin-top: 0; margin-bottom: 0">&nbsp;</td>
		</tr>
		<tr>
			<td width="550" height="20" bgcolor="#004773">
			<p style="margin-top: 0; margin-bottom: 0">&nbsp;</td>
		</tr>
		<tr>
			<td width="550" height="40" bgcolor="#D7D7D7">
			<p style="margin-top: 0; margin-bottom: 0">&nbsp;</td>
		</tr>
		<tr>
			<td width="200" background="medias/vip/ongletback.jpg">
			<p style="margin-top: 0; margin-bottom: 0">&nbsp;</td>
			<td width="550" bgcolor="#D7D7D7">
			<table border="0" style="border-collapse: collapse" width="540" cellpadding="0" id="table2">
				<tr>
					<td width="20" height="20">
					<p style="margin-top: 0; margin-bottom: 0">
					<font face="Verdana">
					<img border="0" src="medias/vip/c1.gif" width="20" height="20"></font></td>
					<td bgcolor="#FFFFFF">
					<p style="margin-top: 0; margin-bottom: 0">&nbsp;</td>
					<td width="20" height="20">
					<p style="margin-top: 0; margin-bottom: 0">
					<font face="Verdana">
					<img border="0" src="medias/vip/c2.gif" width="20" height="20"></font></td>
				</tr>
				<tr>
					<td bgcolor="#FFFFFF">
					<p style="margin-top: 0; margin-bottom: 0">&nbsp;</td>
					<td bgcolor="#FFFFFF">
					<p style="margin-top: 0; margin-bottom: 0">&nbsp;</td>
					<td bgcolor="#FFFFFF">
					<p style="margin-top: 0; margin-bottom: 0">&nbsp;</td>
				</tr>
				<tr>
					<td width="20" height="20">
					<p style="margin-top: 0; margin-bottom: 0">
					<font face="Verdana">
					<img border="0" src="medias/vip/c4.gif" width="20" height="20"></font></td>
					<td bgcolor="#FFFFFF">
					<p style="margin-top: 0; margin-bottom: 0">&nbsp;</td>
					<td width="20" height="20">
					<p style="margin-top: 0; margin-bottom: 0">
					<font face="Verdana">
					<img border="0" src="medias/vip/c3.gif" width="20" height="20"></font></td>
				</tr>
			</table>
			</td>
		</tr>
		<tr>
			<td width="200" background="medias/vip/ongletback.jpg">
			<p style="margin-top: 0; margin-bottom: 0">&nbsp;</td>
			<td width="550" bgcolor="#D7D7D7">
			<p style="margin-top: 0; margin-bottom: 0">&nbsp;</td>
		</tr>
		<tr>
			<td width="200" background="medias/vip/ongletdown.jpg" height="50">
			<p style="margin-top: 0; margin-bottom: 0">&nbsp;</td>
			<td width="550" bgcolor="#004773">
			<p style="margin-top: 0; margin-bottom: 0" align="center">
			<font face="Verdana" size="2" color="#FFFFFF">TECHNI 47 Z.A. du Haut 
			Agenais - BP11 47 500 MONTAYRAL<br>
			Tél : 05 53 40 83 06 Fax : 05 53 40 83 14 Email :
			<a href="mailto:techni47@wanadoo.fr"><font color="#FFFFFF">
			techni47@wanadoo.fr</font></a></font></td>
		</tr>
	</table>
</div>

</body>

</html>


Pour l'instant le menu s'affiche en haut de la page.

Merci de votre aide,
Tiouwzz
Modérateur
Bonsoir,

Que vient faire le menu dans une cellule de tableau ? Tu fais un tableau de menus ? Smiley rolleyes