/    Sign up×
Community /Pin to ProfileBookmark

Bit of an odd question/problem…

Hey folks. I’m trying to make some buttons with css. I’ve got 4 <h3> tags which I’ve designed with css to look like buttons, then I wrapped them in <a> tags to become links, but it doesn’t validate with w3.

here’s the error, which I get 4 times for each of the <h3> links.

[quote]

Line 45, Column 57:

Document type does not allow element “h3” here; missing one of “object”, “applet”, “map”, “iframe”, “button”, “ins”, “del” start-tag

[B]<a href=”#”><h3>Unique Website Design</h3></a>[/B]

[/quote]

Is it not possible to use a <h3> as a link?

Then reason why I want to use h3 for my links, is because I’m under then impression that it may be better for SEO. If this is not the case, please let me know so I can just use a div instead.

cheers!

to post a comment
HTML

4 Comments(s)

Copy linkTweet thisAlerts:
@FangJun 17.2010 — &lt;h3&gt;&lt;a href="#" style="display:block;"&gt;Unique Website Design&lt;/a&gt;&lt;/h3&gt;
Copy linkTweet thisAlerts:
@deXtrousauthorJun 17.2010 — Thanks, but could you possibly explain that?


edit: didn't fix it,

Line 45, Column 101:

document type does not allow element "h3" here; missing one of "object", "applet", "map", "iframe", "button", "ins", "del" start-tag

&#8230; style="display:block; text-decoration:none"><h3>Unique Website Design</h3></a>


The mentioned element is not allowed to appear in the context in which you've placed it; the other mentioned elements are the only ones that are both allowed there and can contain the element mentioned. This might mean that you need a containing element, or possibly that you've forgotten to close a previous element.

One possible cause for this message is that you have attempted to put a block-level element (such as "<p>" or "<table>") inside an inline element (such as "<a>", "<span>", or "<font>").
[/quote]
Copy linkTweet thisAlerts:
@FangJun 17.2010 — The link goes INSIDE the header element. Giving the link display:block means it fills the space allocated to the header.
Copy linkTweet thisAlerts:
@deXtrousauthorJun 17.2010 — Perfect thanks! sorry about that
×

Success!

Help @deXtrous 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 5.9,
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: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,

tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

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