Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > HTML > Wrapping input button with A tag: OK?

Reply
Thread Tools

Wrapping input button with A tag: OK?

 
 
Matthew Wilson
Guest
Posts: n/a
 
      08-05-2008
I need to style a link to be identical to a button. This is what I came
up with. I want to know about downside risks:

<a href="/blah"><input type="button" value="Visit blah" /></a>

As far as I can tell, this works perfectly. It seems to be valid HTML.

Comments?

Matt
 
Reply With Quote
 
 
 
 
Jukka K. Korpela
Guest
Posts: n/a
 
      08-05-2008
Scripsit Matthew Wilson:

> I need to style a link to be identical to a button.


Stop needing that. You don't need to mislead people into confusing
buttons with links.

> This is what I
> came up with. I want to know about downside risks:
>
> <a href="/blah"><input type="button" value="Visit blah" /></a>
>
> As far as I can tell, this works perfectly.


How many browsers did you test it on? The construct is illogical, since
both links and input buttons can be activated, so what happens when you
click on something that is both a link and an input button? Does it
invoke the inner element's functionality, or the outer element's, or
both elements'? Did you already check it on IE 9 and Firefox 4?

> It seems to be valid HTML.


It is valid (even in HTML 4.01, though with a meaning different from
XHTML), but this does not imply that some meaning or specific
functionality has been assigned to it.

--
Jukka K. Korpela ("Yucca")
http://www.cs.tut.fi/~jkorpela/

 
Reply With Quote
 
 
 
 
+mrcakey
Guest
Posts: n/a
 
      08-06-2008
"Matthew Wilson" <> wrote in message
news:...
>I need to style a link to be identical to a button. This is what I came
> up with. I want to know about downside risks:
>
> <a href="/blah"><input type="button" value="Visit blah" /></a>
>
> As far as I can tell, this works perfectly. It seems to be valid HTML.
>
> Comments?
>
> Matt


If you want that, it would be better to create an image of the button
(***with alt text***) and use that instead. It's a curious "need" mind!

+mrcakey

www.manchester-website-design.co.uk


 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Which is faster in ASIC: 2-input AND gate or a 2-input multiplexer Weng Tianxiang VHDL 12 08-11-2005 10:50 AM
text wrapping in input type button? coolsti HTML 10 05-27-2005 07:58 AM
Input Drops With An Empty Input Queue Spiz Cisco 12 05-18-2005 05:28 PM
Coloring input type=input browse button; uploading multiple files Ron Brennan Javascript 5 05-14-2004 08:13 PM
why does form with only 1 text input and 1 button input submit on enter? Guy HTML 5 12-13-2003 06:44 AM



Advertisments
 



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57