Bonjour,
je ve appliquer un style sur mon formulaire html avec une css et l'afficher dans un code php mais ca marche pas pouvez vous m'aider.
voici mon code php qui contient le formulaire:

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
 
<html>
	<head>
	<link rel='stylesheet' href='style.css' type='text/css'/>
	</head>
	<body>
         <?php
	mysql_connect('localhost','root','');
	mysql_select_db('bd_dt');
	$tab_resultat = array('','','','','','','','','','','','','','','','','','','','','');
	$out = '';
	$request ='select * from table1';
	$result = mysql_query($request);
	if($result)
	{
		if($tab_resultat = mysql_fetch_row($result))
		{
		for($i=0;$i<count($tab_resultat);$i++)
			{
			}
		}
	}
         $out.="
			
	<fieldset>
	<legend>Résultat de la recherche</legend>
		<div class='ResultRech'>
			<span class='attribut'>Responsable:</span>
		</div>
		<div class='affichage'>
			<span class='result'>";
						 echo $tab_resultat[5];
	 $out.="</span>
		</div>
		<div class='ResultRech'>
			<span class='attribut'>Date création :</span>
		</div>					
		<div class='affichage'>
			<span class='result'>";
				echo $tab_resultat[8].' hhh';
	$out.="</span>
		</div>
		<div class='ResultRech'>
			<span class='attribut'>Effectif global:</span>
		</div>	
		<div class='affichage'>
			<span class='result'>";
				echo $tab_resultat[19];
	$out.="</span>
		</div>				
		<div class='ResultRech'>
			<span class='attribut'>Siège sociale :</span>
		</div>
		<div class='affichage'>	
			<span class='result'>";
			 echo $tab_resultat[17];
	$out.="</span>
		</div>					
		<div class='ResultRech'>
			<span class='attribut'>Tel :</span>
		</div>
		<div class='affichage'>
			<span class='result'>";
			   echo $tab_resultat[9];
	$out.="</span>
		</div>
		<div class='ResultRech'>
		<span class='attribut'>Fax :</span>
		</div>
		<div class='affichage'>
		<span class='result'>";
			echo $tab_resultat[10];
	$out.="</span>		
	       </div>
		<div class='ResultRech'>
		<span class='attribut'>E-Mail :</span>
		</div>
		<div class='affichage'>
		<span class='result'>";
			echo $tab_resultat[11];
	$out.="</span>
		</div>
		<div class='ResultRech'>
		<span class='attribut'>Site web :</span>
		</div>
		<div class='affichage'>
		<span class='result'>";
		echo $tab_resultat[12]; 
		$out.="</span>					
		</div>
		<div class='ResultRech'>						
		<span class='attribut'>Activité:</span>
		</div>
		<div class ='affichage'>
		<span class='result'>";
 
						/*$varActv = $tab_resultat[1]; 
						$request = 'select LIBELLE_ACT from activitees where NUM_ACT ='.$varActv;					
						$resultat = mysql_query($request);
						if($resultat){
							if($rowAct = mysql_fetch_row($resultat))
							{
								echo $rowAct[0];
							}
						}*/
 
	$out.="</span>
	</div>
	<div class='ResultRech'>
	<span class='attribut'>Statut juridique :</span>
	</div>
	<div class='affichage'>
	<span class='result'>";
 
						/*$varStatut = $tab_resultat[2];
						$request2 = 'select LIBELLE_STATUT from statut_juridique where NUM_STATUT ='.$varStatut;
						$resultat2 = mysql_query($request2);
						if($resultat2)
						{
							if($rowStatut = mysql_fetch_row($resultat2))
							{
								echo $rowStatut[0];
							}
						}*/
		$out.="</span>
		</div>
	      <div class='ResultRech'>
	      <span class='attribut'>N° police d'assurance :</span>
		</div>
	      <div class='affichage'>
		<span class='result'>";
		echo $tab_resultat[14];
		$out.="</span>
		</div>
		<div class='ResultRech'>
		<span class='attribut'>Registre de commerce:</span>
		</div>
		<div class='affichage'>
		<span class='result'>";					
		//echo $tab_resultat[20];					
		$out.="</span></div> </fieldset>";
mysql_close();
?>
</body></html>
et voici la feuille de style que je ve appliquer:

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
.{
	font-family:arial ,verdana sans-serif;
	font-size: 12px;
	}
 
.ResultRech{
	min-width:119px;
	margin:5px 0 0 0;
	background:red;
	text-align:left;
	float:left;
	padding:0 0 0 5px;
}
.affichage{
	min-width:133px;
	margin:5px 0 0 0;
	background:blue;
	text-align:left;
	float:left;
}
.attribut{
	font-size:12px;
	color:#0c5599;
}
.result{
	font-size:12px;
	color:black;
}
et merci