以下是页面右侧的PHP代码。这也是页面的动态部分。请注意,节标记是随着内容动态创建的。Div右侧有动态高度,左侧div是固定的:并排需要
while($row = mysqli_fetch_object($result)){
?>
<section id = "rewardDet">
<br>
<p> <h2><?php echo "N".$row->pledgeAmount. " " . "or more"; ?></h2></p> <br>
<p><span> <br><?php echo $row ->title; ?></span></p> <br>
<p> <span><?php echo $row ->description; ?></span></p> <br>
<p> <span>Estimated Delivery Time: <br> <?php echo $row ->deliverytime . " ". $row ->deliveryyear; ?></span></p> <br>
<p> <span><?php echo $row ->shippingdetails; ?></p></span> <br>
<p> <span>Number of Rewards Available: <br><?php echo $row ->reward1No; ?></span></p>
</section>
这是动态右侧
#rewardDet{
min-height:400px; /* 400 */
width:25%; /* 360 */
margin-top:0.8%; /* 10 */
margin-bottom:0.8%; /* 10 */
margin-right: 14.08%; /* 200 */
float: right;
}
的CSS下面是左侧的CSS。这应该是直接在右侧,但它是由于右侧的div占据了所有空间。
#projDet{
min-height: 400px; /* 400 */
width: 41.67%; /* 600 */
margin-top: 0.8%; /* 10 */
margin-bottom:0.8%; /* 10 8*/
margin-left:14.08%; /* 200 */
float: left;
}
请帮我让他们保持并排。这让我很头疼。
这是整个页面的代码
<!DOCTYPE html>
<html>
<head>
<link href="https://fonts.googleapis.com/css?family=Roboto" type="text/css" rel="stylesheet" >
<link type="text/css" rel="stylesheet" href="stylesheet.css" />
</head>
<body>
<!-- about and reward title -->
<div id = "aboutProjH">
<h2> About This Project </h2>
</div>
<div id = "rewardH">
<h2> Rewards For Supporting This Project</h2>
</div>
<div id = "clearer"> </div>
<!--project pic and dynamic rewards-->
<div id = "projPic">
<img src="<?php echo $rowe ->fileToUpload;?>" width = "100%" height = "100%">
</div>
<section id = "rewardDet">
<br>
<p> <h2><?php echo "N".$row->pledgeAmount. " " . "or more"; ?></h2></p> <br>
<p><span> <br><?php echo $row ->title; ?></span></p> <br>
<p> <span><?php echo $row ->description; ?></span></p> <br>
<p> <span>Estimated Delivery Time: <br> <?php echo $row ->deliverytime . " ". $row ->deliveryyear; ?></span></p> <br>
<p> <span><?php echo $row ->shippingdetails; ?></p></span> <br>
<p> <span>Number of Rewards Available: <br><?php echo $row ->reward1No; ?></span></p>
</section>
<div id = "clearer"> </div>
<?php
}
}
}
?>
<div id = "clearer"> </div>
<!-- project details and empty divs -->
<div id = "projDet">
<span><?php echo $rowe ->projectdetails2; ?> </span>
</div>
<!--<div id = "bsideProjDet">
</div> -->
<div id = "clearer"> </div>
</body>
</html>
的PHP无关你的问题。请发布呈现的HTML。 – j08691
ID为rewardDet的部分标记是呈现页面右侧的HTML。左侧HTML/PHP是\t \t \t \t \t \t \t \t
如果我需要提供更多的信息,请让我知道,因为我相信我有。@ j08691。 – Afe