Oddly, I have to see what you are doing with that image and/or what that image is to weigh in -- since to be honest if possible I'd have the published date inside a span inside the H3 since it's part of the heading.
The image just leaves me asking why the DIV, why the redundant title on IMG (If you're GOING to use title there, it goes on the anchor to say where the anchor is going, while alt is the text for users with images off -- they should rarely be the same or both included)... from a semantic standpoint I'm unsure that img is actually content, I WOULD put the anchor in the h3 making it's text part of the link....
Code:
echo '
<h3>
<a href="',BASE_URL,'articles/postage-meters-can-save-you-money">
Postage Meters Can Save You Money
<img
src="',BASE_URL,'images/PostageMeter.png"
width="170"
alt="Postage Meter. Credit: John Doe, Wikimedia Commons."
/>
</a>
Published: December 31, 2011
</h3>';
Basically treating that all as part of the heading -- though if the image is something like just an icon, I'd consider moving it either out of the HTML completely if it's a standard article icon you re-use a lot, or if it's a one-off that's one of the VERY RARE instances I'd allow for the style attribute... which would gut it down to:
Code:
echo '
<h3>
<a
href="',BASE_URL,'articles/postage-meters-can-save-you-money"
style="background-image:url(',BASE_URL,'images/PostageMeter.png);"
>Postage Meters Can Save You Money</a>
Published: December 31, 2011
</h3>';
or even less if it's a common image. If the image is just presentation and not actual content -- which seemed to be the case here (though guessing since I'm not seeing the image) there's no reason for it to have a HTML element assigned to it. Also since the anchor would make the style hook for the first textnode, you'd not even need anything extra to target the second one. Makes a lot more sense from a semantics standpoint, would have better accessibility since people wouldn't be hunting for the link (which images as links can do), and it's significantly less markup.
...and as always I'd swing an axe at all the <?php ?> and placement of redundant comments that could actually trip rendering bugs... the outdated clearfix nonsense...
Bookmarks