Bonjour,

J'ai effectué plusieurs recherches pour aligner verticalement un bloc div.

Il y a plusieurs solutions utilisées mais chaque fois il y a un problème, je ne comprend pas

Voici mon code :

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
<!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" xml:lang="en">
	<head>
		<title>tests</title>
		<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-15" />
		<meta http-equiv="Content-Style-Type" content="text/css" />
		<meta http-equiv="Content-Language" content="fr" />
		<style type="text/css">
			html,body,div
			{
				height: 100%;
			}
 
			div
			{
				display: table-cell;
				vertical-align: middle;
			}
 
			p
			{
				font: 0.8em "Trebuchet MS", helvetica, sans-serif;
				text-align: center;
			}
 
			p a
			{
				color: #406CBF;
				text-decoration: none;
			}
 
			p a:hover
			{
				color: #19366E;
				text-decoration: underline;
			}
		</style>
	</head>
 
	<body>
		<div><p><img src="img.jpg" alt="logo" /><br />
		<a href="index2.php">Entrer</a></p></div>
	</div>
	</body>
</html>
D'avance merci pour vos réponses.