简体   繁体   中英

HTML/CSS: Image Not being displayed

I seem to be having this weird issue going on where I can not get my image view to display at all. The form completely ignores it as if it never existed. I have verified the image source url is confirmed. Currently the code looks like the following:

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>";
}

and I am using the following 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;
}

But I am getting results are shown in the following image: here

You are missing an echo just after your foreach statement

foreach ($data as $product) {
    echo "
    <div class='content'>

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM