Problème d'affichage menu CSS
Bonjour à tous,
je réalise mon premier site web avec les CSS. J'ai un problème au niveau de l'affichage du menu: avec Firefox, il s'affiche plus ou moins bien; mais avec IE et Chrome c'est la cata. J'ai plusieurs préoccupations.
Je voudrais savoir comment faire en sorte que le menu conserve la meme largeur que l'image banniere_800x325.jpg sous tous les navigateurs?
Ensuite pourquoi la searchbar est-elle décalée sous Chrome?
Comment gérer les traits de séparation transparent entre chaque menu sous IE?
Voici mon code:
Code:
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 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156
|
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>..:: | Home ::..</title>
<style type="text/css">
<!--
body {
margin-top: 0px;
margin-bottom: 0px;
}
-->
</style>
<link href="css/css.css" rel="stylesheet" type="text/css" />
<script type="text/javascript">
<!--
sfHover = function()
{
var sfEls = document.getElementById("menu").getElementsByTagName("LI");
for (var i=0; i<sfEls.length; i++)
{
sfEls[i].onmouseover=function()
{
this.className+=" sfhover";
}
sfEls[i].onmouseout=function()
{
this.className=this.className.replace(new RegExp(" sfhover\\b"), "");
}
}
}
if (window.attachEvent) window.attachEvent("onload", sfHover);
-->
</script>
</head>
<body>
<table width="800" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td height="325" colspan="4" style="background-image:url(images/banniere_jpg_800x325.jpg)"> </td>
</tr>
<tr>
<td colspan="4">
<div id="menu">
<ul id="menu">
<li>
<a href="index.html">Home</a> </li>
<li>
<a href="#">Company</a>
<ul>
<li><a href="who_are_we.html">Who are we</a></li>
<li><a href="careers.html">Careers</a></li>
<li><a href="jobs.html">Jobs</a></li>
</ul>
</li>
<li>
<a href="#">Products</a>
<ul>
<li><a href="hi_tech_solutions.html">Hi-Tech Solutions</a></li>
<li><a href="banking_solutions.html">Banking Solutions</a></li>
<li><a href="telecoms.html">Telecoms</a></li>
</ul>
</li>
<li>
<a href="support.html">Support</a> </li>
<li>
<a href="contacts.html">Contacts</a> </li>
<li>
<div id="search_bar">
<form action="" method="get" name="search" id="search">
<input id="query" name="query" size="18" type="text" value="" />
<button type="submit">OK</button>
</form>
</div>
</li>
</ul>
</div> </td>
</tr>
<tr>
<td colspan="4"><table width="762" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td colspan="2"><p align="center"><strong>TECHNOLOGIES</strong></p></td>
<td width="82"> </td>
<td colspan="2"><p align="center"><strong>EVENTS</strong></p></td>
</tr>
<tr>
<td width="135" rowspan="2"></td>
<td width="205"><p align="justify">ici news tech ici news tech ici news tech ici news tech ici news tech ici news tech ici news tech ici news tech ici news tech ici news tech ici news tech ici news tech ici news tech ici news tech ...</p></td>
<td rowspan="2"></td>
<td width="135" rowspan="2"></td>
<td width="205"><p align="justify">ici news events ici news events ici news events ici news events ici news events ici news events ici news events ici news events ici news events ici news events ici news events ici news events ici news eventsici news ...</p></td>
</tr>
<tr>
<td><div align="right"><img src="images/read_more_jpg_85x21.jpg" alt="read more" width="85" height="21" border="0" /></div></td>
<td><div align="right"><img src="images/read_more_jpg_85x21.jpg" alt="read more" width="85" height="21" border="0" /></div></td>
</tr>
<tr>
<td colspan="2"></td>
<td></td>
<td colspan="2"></td>
</tr>
<tr>
<td colspan="2"><p align="center"><strong>PRODUCTS</strong></p></td>
<td></td>
<td colspan="2"><p align="center"><strong>NEWSLETTER</strong></p></td>
</tr>
<tr>
<td rowspan="2"></td>
<td><p align="justify">ici news products ici news products ici news products ici news products ici news products ici news products ici news products ici news products ici news products ici news products ici news products ici news products ... </p></td>
<td rowspan="3"></td>
<td rowspan="2"></td>
<td><p align="justify">ici newsletter ici newsletter ici newsletter ici newsletter ici newsletter ici newsletter ici newsletter ici newsletter ici newsletter ici newsletter ici newsletter ici newsletter ici newsletter ici newsletter ... </p></td>
</tr>
<tr>
<td><div align="right"><img src="images/read_more_jpg_85x21.jpg" alt="read more" width="85" height="21" border="0" /></div></td>
<td><div align="right"><img src="images/read_more_jpg_85x21.jpg" alt="read more" width="85" height="21" border="0" /></div></td>
</tr>
<tr>
<td colspan="2"> </td>
<td colspan="2"> </td>
</tr>
</table></td>
</tr>
<tr>
</tr>
<tr>
</tr>
<tr>
</tr>
<tr>
<td colspan="4"> </td>
</tr>
<tr>
<td height="36" colspan="4" style="background-image:url(images/footer_jpg_800x36.jpg)"> </td>
</tr>
</table>
</body>
</html> |
Et la feuille de style:
Code:
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 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120
|
#menu, #menu ul /* Liste */
{
padding : 0;
margin : 0;
list-style : none;
line-height : 35px;
text-align : center;
}
#menu /* Ensemble du menu */
{
font-family : Agency FB;
font-size : 20px;
}
#search_bar
{
background-color:#666666;
padding-left:3px;
padding-right:2.75px;
margin-right:0px;
width:auto;
}
#menu a /* Contenu des listes */
{
display : block;
padding : 0;
background : #000000;
color:#FFFFFF;
text-decoration : none;
width : 120.5px;
}
/*#menu a:visited
{
background:#999999;
color:#FFFFFF;
}*/
#menu a:hover
{
background:#FF9900;
color:#FFFFFF; /*police*/
font-size:1.1em; /*effet zoom sur la taille de la police*/
}
/*#menu a:active
{
background:#999999;
color:#FFFFFF;
}*/
#menu li /* Éléments des listes */
{
float : left;
}
/*html>body */#menu li
{
border-right: 1px solid transparent ;
}
#menu li ul /* Sous-listes */
{
position: absolute;
width: 120.5px;
left: -999em;
}
#menu li ul li /* Eléments de sous-listes */
{
border-top : 1px solid #fff; /* on met une bordure blanche en haut de chaque élément d'une sous-liste */
}
/*html>body */#menu li ul li
{
border-top : 1px solid transparent; /* on met une bordure transparente en haut de chaque élément */
}
#menu li ul ul
{
margin : -22px 0 0 120.5px ;
border-left : 1px solid #fff ;
}
/*html>body */#menu li ul ul
{
border-left : 1px solid transparent ;
}
#menu li:hover ul ul, #menu li.sfhover ul ul /* Sous-sous-listes lorsque la souris passe sur un élément de liste */
{
left: -999em; /* On expédie les sous-sous-listes hors du champ de vision */
}
#menu li:hover ul, #menu li li:hover ul, #menu li.sfhover ul, #menu li li.sfhover ul /* Sous-listes lorsque la souris passe sur un élément de liste ET sous-sous-lites lorsque la souris passe sur un élément de sous-liste */
{
left: auto; /* Repositionnement normal */
min-height: 0; /* Corrige un bug sous IE */
} |
Une fois de plus, je suis débutant donc si vous voulez bien me faire part de mes autres erreurs je vous en serai reconnaissant.