/    Sign up×
Community /Pin to ProfileBookmark

The newbie way to do this was (it worked as it should):

>

<a href=”/about”> <button class=”navbtn”>About</button></a>

But gets an error “The element button must not appear as a descendant of the a element.”

Trying to mimic a button works in JSfiddle:
https://jsfiddle.net/hfd6zek7/1/

Which looks like this in Chrome:

[upl-image-preview url=https://www.webdeveloper.com/assets/files/2019-07-10/1562751104-599735-chrome.png]

But in Safari:
[upl-image-preview url=https://www.webdeveloper.com/assets/files/2019-07-10/1562751157-463145-safari.png]

What am I doing wrong? Trying to avoid Javascript.

to post a comment
CSSHTML

2 Comments(s)

Copy linkTweet thisAlerts:
@NogDogJul 10.2019 — The semantic solution would be to just use an &lt;a&gt; element and then style it in your CSS to look/act like a button.

A somewhat ugly (IMHO) solution would be to put a submit button inside a form element whose action is the desired link.
Copy linkTweet thisAlerts:
@sibertauthorJul 10.2019 — Thank you, but it was just to clear cache. I am ashamed.
×

Success!

Help @sibert spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 4.24,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,

tipper: @Samric24,
tipped: article
amount: 1000 SATS,
)...