Forum Moderators: coopster
Is there any way of making Sold red in color
<span class = "superemphatic">Sold</span>
span.superemphatic {color: red;}
That was an HTML/CSS suggestion, nothing to do with the php as such.
div.prcolor span {blahblah}
? (Perfectly legitimate, but looks funny.) <span>
</span>
for all the products that have not been sold? Seems wasteful. (That is, you're sending content to the browser that it doesn't need.)
echo "<span>Sold</span>"
The command "echo" doesn't mean "display this text where a human can see it". It means "put this text in the raw HTML". (This is why I echo things like \n that serve absolutely no purpose. I'm obsessive about making everything look hand-rolled.)
What's the naked <span> for? Does the CSS say
div.prcolor span {blahblah}
.prodprice {text-align: center;}
.prodprice span {margin-left: .875em; color: #cd5c5c;} <figure>
<a href="http://www.example.com/<?php echo ($item["produrl"]); ?>">
<img src="http://www.example.com/<?php echo ($item["galimg"]); ?>" alt="" width="225" height="168"></a>
<figcaption>
<a href="http://www.example.com/<?php echo ($item["produrl"]); ?>">
<h3><?php echo ($item["prodnm"]); ?></h3>
</a>
<div class="prodprice">
<?php echo ($item["prodprice"]); ?>
<?php echo ($item["status"] == 'sold' ? '<span>SOLD</span>' : '' ); ?>
</div>
</figcaption>
</figure>
I put the span inside the div because it was the only way to get the sometimes "SOLD" to stay on the same line as the always "price".