• In contents.php, there’s an <article> element that displays the titles of my posts, in which there is an <h2> tag that is anchored to the actual post it represents.

    I want to take this anchor tag and anchor the entire article itself (i.e. <article></article>.

    Unfortunately, this doesn’t correctly anchor the article. When I inspect the article in Chrome, it looks like this: <article></article>

    What am I doing wrong? How I anchor the entire article?

Viewing 1 replies (of 1 total)
  • Moderator bcworkz

    (@bcworkz)

    You can move the anchor tags to enclose anything you like on your theme templates (be sure the surrounding tags nest properly though), but it may not have a desirable effect. If you anchor the entire article, when a user hovers over the article, the entire article will take on the hover CSS style. I sometimes see this effect due to malformed HTML. If anyone were to do this on purpose, I would assume the HTML is malformed just because I’m used to only the title taking on the hover style. Seeing what appears to be malformed HTML does not present the site owner in a good light, it appears they cannot put together a basic page that validates.

    I would suggest you not worry so much what Chrome inspector is showing and focus on the user experience. It’s your site though, do as you please.

Viewing 1 replies (of 1 total)
  • The topic ‘Anchoring an entire (contents.php)?’ is closed to new replies.