| | #1 |
| Active Warrior Join Date: 2009
Posts: 95
Thanks: 111
Thanked 8 Times in 7 Posts
|
Would it cause any problems in the website or any browers? <a href="whatever.html'><button>text in here</button></a> Is there a better alternative? Thanks. |
| | |
| | |
| | #2 |
| New Warrior Member Join Date: 2018 Location: Bangladesh
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
|
Thanks, Brother
|
| | |
| | #3 |
| Active Warrior Join Date: 2009
Posts: 95
Thanks: 111
Thanked 8 Times in 7 Posts
| |
| | |
| | |
| | #4 |
| Senior Warrior War Room Member Join Date: 2002 Location: Mobile, Al
Posts: 23
Thanks: 23
Thanked 16 Times in 14 Posts
|
To be honest, I am a big fan of bootstrap. Using bootstrap you can just apply a button style to an anchor link and get the desired visual effect of a button. To do this without using booststrap, you should remove the button code, and just use css to style the link to look like a button. For a more advanced method, use javascript for the linking. https://codepen.io/svinkle/pen/FHGBh |
| Last edited on 14th Aug 2018 at 12:11 AM. Reason: Additional Resource | |
| | |
| The Following 2 Users Say Thank You to Michael D Price For This Useful Post: |
| | #5 |
| New Warrior Member Join Date: 2018 Location: Belgrade, Serbia
Posts: 4
Thanks: 0
Thanked 3 Times in 2 Posts
| No, it isn't valid HTML5 according to the HTML5 Spec Document from W3C: In other words, you can nest any elements inside an <a> except the following: Code: <a> <audio> (if the controls attribute is present) <button> <details> <embed> <iframe> <img> (if the usemap attribute is present) <input> (if the type attribute is not in the hidden state) <keygen> <label> <menu> (if the type attribute is in the toolbar state) <object> (if the usemap attribute is present) <select> <textarea> <video> (if the controls attribute is present) If you are trying to have a button that links to somewhere, wrap that button inside a <form> tag as such: Code: <form style="display: inline" action="http://example.com/" method="get"> <button>Visit Website</button> </form> |
| | |
| The Following User Says Thank You to srdjanm For This Useful Post: |
| | #6 | |
| New Warrior Member Join Date: 2017
Posts: 1
Thanks: 0
Thanked 2 Times in 1 Post
|
https://superdevresources.com/super-...st-button-css/ | |
| | |
| The Following 2 Users Say Thank You to Jari Niemi For This Useful Post: |
| | #7 |
| ANJAN KUMAR DHALI Join Date: 2014 Location: Bangladesh
Posts: 73
Thanks: 3
Thanked 18 Times in 12 Posts
|
<a class="button" href="#">This is Button</a> <style> .button{ padding:5px; background:black; color:white; border-radius:5px; } a{ text-decoration:none; } </style> |
| | |
| | |
| The Following User Says Thank You to ANJANBD For This Useful Post: |
| | #8 |
| New Warrior Member Join Date: 2018
Posts: 1
Thanks: 0
Thanked 1 Time in 1 Post
|
There is no alternate tag for <a> in HTML. But you can create it's alternative using JavaScript. It is way less efficient than <a> tag. But if you still want to do it, follow me. HTML: <body> <p class="para"> <span id="redirect"> </span> </p> CSS: .para { font-family: sans-serif; color: #F00; font-size: 127%; text-decoration: none; } #redirect { font-family: inherit; color: #0F0; text-decoration: underline; } JavaScript: document.getElementById("redirect").onclick(redire ct()); function redirect() { window.location.href="whatever.html"; //May load a cached page }; |
| | |
| The Following User Says Thank You to swati tiwari For This Useful Post: |
| | #9 | |
| Active Warrior Join Date: 2009
Posts: 95
Thanks: 111
Thanked 8 Times in 7 Posts
|
| |
| | ||
| | |
| | #10 |
| New Warrior Member Join Date: 2018
Posts: 5
Thanks: 0
Thanked 2 Times in 2 Posts
|
Add "display:block;" to "button" class, then whole button will be clickable.
|
| | |
| The Following User Says Thank You to Marek Anral For This Useful Post: |
| | #11 |
| New Warrior Member Join Date: 2019
Posts: 1
Thanks: 0
Thanked 1 Time in 1 Post
|
<input type="button" class="btn btn-info" value="Input Button" onclick=" relocate_home()"> <script> function relocate_home() { location.href = "www.yoursite.com"; } </script> |
| | |
| The Following User Says Thank You to shraddha patel For This Useful Post: |
| Bookmarks |
| Tags |
| button, combining, href, tag |
| |