Forum Moderators: open

Message Too Old, No Replies

This line won't validate

         

Digmen1

8:36 am on Jun 9, 2020 (gmt 0)

10+ Year Member Top Contributors Of The Month



This nav bar works on the internet, but it won't validate

<div class="navbar">
<a href="index.htm"><button class="btn-nzi">Home</button></a>
<a href="http://nzissues.com/Community" target="_blank"><button class="btn-nzi">Forum</button></a>
</div>

Any ideas?

phranque

9:10 am on Jun 9, 2020 (gmt 0)

WebmasterWorld Administrator 10+ Year Member Top Contributors Of The Month



see the HTML specification for the A element:
https://html.spec.whatwg.org/#the-a-element

... there must be no interactive content descendant, ...

that means no button elements within a elements.

lucy24

4:22 pm on Jun 9, 2020 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



In this case, it seems redundant. If there’s a simple HTML <a href>, why does there need to be a <button>? If it’s just done for visuals, you could easily style links in the navbar to look like buttons.

JAB Creations

11:56 am on Aug 13, 2020 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Two experience points for you:

1. Never post a thread with a horribly generic title; include a concise portion of the exact error message because if no one here can fix it and someone like me did fix it I'd be inclined to come back and answer it even if it was months or years later (Reddit is fail).

2. You're new and that's fine though if you're going to truly learn code WordPress is a terrible thing to establish any sense of what is acceptable. If you're just trying to use something and don't care much about code I'd highly recommend going on Duck Duck Go (not Google) and researching the benchmarks of various CMS platforms.

Good luck.

John