Wrapping input button with A tag: OK?

Discussion in 'HTML' started by Matthew Wilson, Aug 5, 2008.

  1. 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
     
    Matthew Wilson, Aug 5, 2008
    #1
    1. Advertising

  2. 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/
     
    Jukka K. Korpela, Aug 5, 2008
    #2
    1. Advertising

  3. Matthew Wilson

    +mrcakey Guest

    "Matthew Wilson" <> wrote in message
    news:1.com...
    >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
     
    +mrcakey, Aug 6, 2008
    #3
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. shruds
    Replies:
    1
    Views:
    933
    John C. Bollinger
    Jan 27, 2006
  2. coolsti
    Replies:
    10
    Views:
    8,041
    Jukka K. Korpela
    May 27, 2005
  3. TheTamdino

    <p> tag not wrapping

    TheTamdino, Jan 14, 2007, in forum: HTML
    Replies:
    2
    Views:
    1,414
    Jukka K. Korpela
    Jan 14, 2007
  4. john woo
    Replies:
    1
    Views:
    166
    David Dorward
    Jun 29, 2005
  5. visu
    Replies:
    4
    Views:
    325
Loading...

Share This Page