Bonjour,
je ne parviens toujours pas à centrer mon menu.
Où est l'erreur ? J’ai essayé des text align center partout mais sans succès.
Seul un padding left dans ul de 230px me permet de le faire glisser vers le centre.

PS: si vous voyez des codes inutiles, les remarques sont les bienvenues !
J’ai vraiment du mal à faire des menus et je ne suis pas encore au bout de mes peines car après je souhaite faire des menus déroulants sous les menus-(

Merci
Marc

Code : Sélectionner tout - Visualiser dans une fenêtre à part
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
157
158
159
 
<!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=utf-8" />
<title>Untitled Document</title>
<style type="text/css">
<!--
body {
	font: 100% Verdana, Arial, Helvetica, sans-serif;
	background: #666666;
	margin: 0;
	padding: 0;
	text-align: center;
	color: #000000;
}
 
#container {
	width: 780px;
	margin: 0 auto;
	border: 1px solid #000000;
	text-align: left;
	background-color: #eeeeee;
}
 
#header {
	background: #DDDDDD; 
	padding: 0 10px 0 20px;
}
 
#header h1 {
	margin: 0; 
	padding: 10px 0;
}
 
#mainContent {
	padding: 0 20px;
	background-color: #dddddd;
}
 
#footer {
	padding: 0 10px;
	background:#DDDDDD;
}
 
#footer p {
	margin: 0; 
	padding: 10px 0;
}
 
 
#menu {
	width:780px;
	height:30px;
	padding:0px;
	clear:both;
	background-color:#416271;
}
 
#menu ul {
	list-style:none;
	margin:auto;
	display:block;
	padding-top: 0;
	padding-right: 0;
	padding-bottom: 0;
	padding-left: 0px;
}
 
#menu ul li {
	list-style:none;
	display:inline;
	width:auto;
	height:30px;
	padding:0px;
	font-family:Arial, Helvetica, sans-serif;
	font-size:13px;
	line-height: 30px;
	float: left;
}
 
#menu ul li a {
	height:30px;
	width:auto;
	float:left;
	text-decoration:none;
	color:#fff;
	margin-top: 0px;
	margin-right: 3px;
	margin-bottom: 0px;
	margin-left: 3px;
	padding-top: 0;
	padding-right: 0;
	padding-bottom: 0;
	padding-left: 25px;
}
 
#menu ul li a:hover {
	height:30px;
	width:auto;
	text-decoration:underline;
	color:#fff;
	padding-top: 0;
	padding-right: 0;
	padding-bottom: 0;
	padding-left: 25px;
	background-repeat: no-repeat;
	background-position: left;
}
 
#menu ul li a.current {
	height:30px;
	width:auto;
	float:left;
	text-decoration:underline;
	color:#fff;
	padding-top: 0;
	padding-right: 0;
	padding-bottom: 0;
	padding-left: 25px;
	background-repeat: no-repeat;
	background-position: left;
}
 
 
-->
</style>
</head>
 
<body>
 
<div id="container">
  <div id="header">
    <h1>Header</h1>
  <!-- end #header --></div>
 
   <div id="menu">
   		<ul>
        		<li><a class="current" href="home.html" title="">home</a></li>
            	<li><a href="home.html" title="">services</a></li>
            	<li><a href="home.html" title="">clients</a></li>
            	<li><a href="home.html" title="">testimonials</a></li>
           		<li><a href="home.html" title="">contact us</a></li>
        	</ul>
 
    </div>  <!--menu-->
 
 
  <div id="mainContent">
    <h1> Main Content </h1>
    <p>Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Praesent aliquam,  justo convallis luctus rutrum, erat nulla fermentum diam, at nonummy quam  ante ac quam. Maecenas urna purus, fermentum id, molestie in, commodo  porttitor, felis. Nam blandit quam ut lacus. Quisque ornare risus quis  ligula. </p>
 
	<!-- end #mainContent --></div>
  <div id="footer">
    <p>Footer</p>
  <!-- end #footer --></div>
<!-- end #container --></div>
</body>
</html>