我似乎有这个奇怪的问题,我根本无法显示我的图像视图。表格完全忽略它,好像它从未存在过。我已经确认图像源网址已确认。目前代码如下所示:
echo "
<html>
<head>
<link rel='stylesheet' type='text/css' href='mycss.css'>
</head>
<header>
</header>
<body>";
foreach ($data as $product) {
"
<div class='content'>
<img src='/images/" . $product->image . ".jpg' alt='' height='262' width='262'>
<div class='container clearfix'>
<p>Product: ". $product->product."</p>";
foreach ($product->size as $index => $value) {
echo "
<p> Size: ". $product->size[$index]." Qty: ". $product->qty[$index] ."</p>";
}
echo "
<p>Vendor Sku: ".$product->vendor_sku."</p>
</div>
</div>";
}
我正在使用以下css:
.clearfix:before,
.clearfix:after {
content: "";
display: table;
}
.clearfix:after {
clear: both;
}
.clearfix {
zoom: 1; /* ie 6/7 */
}
.content img {
margin-right: 15px;
float: left;
}
.second{
float:right;
}
.res {
height:60px;
background-color:yellow;
border-bottom:1px solid black;
}
img, .text{
vertical-align:top;
margin-right: 15px;
}
.text{
display:inline-block;
}
p, h5{
margin:0;
padding:0;
}
但我得到的结果显示在下图中:here
答案 0 :(得分:1)
在你的foreach声明
之后,你错过了一个回声foreach ($data as $product) {
echo "
<div class='content'>