Cela devrait être simple, c'est juste trois balises div à l'intérieur d'une autre balise div. Les trois balises div devraient juste s'aligner dans une rangée. Au lieu de cela, ils sont alignés verticalement. Rien de ce que je fais ne semble le réparer.Pourquoi ne pas utiliser correctement cette position avec css?
<head>
<link href="css.css" rel="stylesheet" type="text/css" />
</head>
<body>
<?php
function NameChange($num) {
$card = $_POST["state".$num];
$spaces = " ";
$underscore = "_";
$imagename = str_replace($spaces, $underscore, $card);
return $imagename;
}
?>
<div id="main">
<div id="3c1">
<?php
echo '<script type="text/javascript">
function myPopup1() {
window.open("images/'.NameChange(1).'.jpg", "myWindow",
"status = 1, height = 691, width = 468, resizable = 0")
}
</script>';
echo '<script type="text/javascript">
function myPopup2() {
window.open("images/'.NameChange(2).'.jpg", "myWindow",
"status = 1, height = 691, width = 468, resizable = 0")
}
</script>';
echo '<script type="text/javascript">
function myPopup3() {
window.open("images/'.NameChange(3).'.jpg", "myWindow",
"status = 1, height = 691, width = 468, resizable = 0")
}
</script>';
echo '<img src=images/'.NameChange(1).'_tn.jpg />';
echo "<br />";
echo '<input type="button" onClick="myPopup1()" value="Image">';
echo '<script type="text/javascript">
function myPopup1t() {
window.open("/'.$_POST[state1].'.html", "myWindow",
"status = 1, height = 691, width = 468, resizable = 0")
}
</script>';
echo '<input type="button" onClick="myPopup1t()" value="Meaning">';
?>
</div>
<div id="3c2">
<?php
echo '<img src=images/'.NameChange(2).'_tn.jpg />';
echo "<br />";
echo '<input type="button" onClick="myPopup2()" value="Image">';
echo '<script type="text/javascript">
function myPopup2t() {
window.open("/'.$_POST[state2].'.html", "myWindow",
"status = 1, height = 691, width = 468, resizable = 0")
}
</script>';
echo '<input type="button" onClick="myPopup2t()" value="Meaning">';
?>
</div>
<div id="3c3">
<?php
echo '<img src=images/'.NameChange(3).'_tn.jpg />';
echo "<br />";
echo '<input type="button" onClick="myPopup3()" value="Image">';
echo '<script type="text/javascript">
function myPopup3t() {
window.open("/'.$_POST[state3].'.html", "myWindow",
"status = 1, height = 691, width = 468, resizable = 0")
}
</script>';
echo '<input type="button" onClick="myPopup3t()" value="Meaning">';
?>
</div>
</div>
</body>
Et le CSS
#main {
width: 808px;
margin-right: auto;
margin-left: auto;
left: auto;
right: auto;
border-top-style: solid;
border-right-style: solid;
border-bottom-style: solid;
border-left-style: solid;
}
#main #3c1 {
height: 200px;
width: 200px;
display: inline;
}
#main #3c2 {
height: 200px;
width: 200px;
display: inline;
}
#main #3c3 {
height: 200px;
width: 200px;
display: inline;
}
Il a dit dans la question qu'il les voulait dans une rangée, mais ils sont dans une colonne à la place. –
mon mauvais, j'ai mal lu la question. – s84
Float ne fonctionne pas non plus – Expecto