Register

If this is your first visit, please click the Sign Up now button to begin the process of creating your account so you can begin posting on our forums! The Sign Up process will only take up about a minute of two of your time.

Results 1 to 4 of 4
Like Tree2Likes
  • 1 Post By mlseim
  • 1 Post By mlseim

Thread: Combining a href + the button tag?

  1. #1
    Junior Member
    Join Date
    Oct 2015
    Posts
    14
    Member #
    52369
    Liked
    1 times

    Combining a href + the button tag?

    Would the following code cause any problems in the website or browsers?

    <a href="whatever.html'><button>text in here</button></a>

    Are there other ways to do the above? Thanks.

  2.  

  3. #2
    WDF Staff mlseim's Avatar
    Join Date
    Apr 2004
    Location
    Cottage Grove, Minnesota
    Posts
    7,772
    Member #
    5580
    Liked
    723 times
    If you are not using a <form> but wish to duplicate the "look" of a button, and you don't want to use a graphic image, use CSS to make a button.

    Example:
    https://css-tricks.com/examples/ButtonMaker/#

    That would be the most compliant across all browsers.
    dansbanners likes this.


  4. #3
    Junior Member
    Join Date
    Oct 2015
    Posts
    14
    Member #
    52369
    Liked
    1 times
    Quote Originally Posted by mlseim View Post
    If you are not using a <form> but wish to duplicate the "look" of a button, and you don't want to use a graphic image, use CSS to make a button.

    Example:
    https://css-tricks.com/examples/ButtonMaker/#

    That would be the most compliant across all browsers.
    I got that. Thanks. However, I'm really wondering how to make the button clickable. Which is why I asked if having the button tag within the a href attribute as stated in the op would do the trick?

  5. #4
    WDF Staff mlseim's Avatar
    Join Date
    Apr 2004
    Location
    Cottage Grove, Minnesota
    Posts
    7,772
    Member #
    5580
    Liked
    723 times
    You can use jquery (javascripting) with a click event.

    Your question was about "another way to do it".

    I don't see anything wrong with doing it the way you described ... with the <button> tag.

    That tag is supported by all browsers:
    https://www.w3schools.com/tags/tag_button.asp

    The only problem might be that each browser renders their <button> differently, so you would need to use CSS to force the "look" of the button.
    dansbanners likes this.



Remove Ads

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
All times are GMT -6. The time now is 02:22 PM.
Powered by vBulletin® Version 4.2.3
Copyright © 2020 vBulletin Solutions, Inc. All rights reserved.
vBulletin Skin By: PurevB.com