largeur d'un bouton en PHP???
bonjour à tous,
voila j'essaie depuis plusieurs heures faire un truc qui pourtant devrait etre simple: créer des boutons de taille fixe.
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
| <!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" lang="fr" xml:lang="fr">
<style type="text/css">
a.boutoncss:link
{
width:150px;
height:30px;
text-decoration:none;
color:white;
text-align:center;
font-weight:bold;
background-color:#000080;padding:5px;
}
a.boutoncss:visited
{
width:150px;
height:30px;
text-decoration:none;
color:white;
text-align:center;
font-weight:bold;
background-color:#000080;
padding:5px
}
a.boutoncss:hover
{
width:150px;
height:30px;
text-decoration:none;
color:white;
text-align:center;
font-weight:bold;
background-color:#0000FF;
background-image:url(aqua.jpg);
padding:5px
}
.boutoncss{text-align:center;padding:5px;}
</style>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=windows-1252" />
<title></title>
</head>
<body>
<p class="boutoncss" style="text-align:center"><a href="cours3.php" class="boutoncss">Cliquez ici !</a></p>
</body>
</html> |
Or avec ce code dans un fichier .PHP j'obtiens un bouton dont la largeur est adaptée au contenu.
Si je renomme mon fichier en .htm, j'ai la meme chose. Par contre si je rajoute la ligne: <?xml version="1.0" encoding="windows-1252"?>, le bouton prend la bonne taille.
Malheureusement quand je ragjoute cette ligne dans le fichier .PHP il me fait une erreur sur cette ligne. j'utilise easyPHP à titre informatif.
D'avance merci pour toute aide :wink: