HTML to center and open in new window |
HTML to center and open in new window |
magnus1 |
Mar 12 2019, 05:47 PM
Post
#1
|
Group: Members Posts: 6 Joined: 20-November 16 Member No.: 24,935 |
Hi,
Can someone please alter this code so it centers the "book call" text and opens the link in a new window? Thank you so much! <form> <input style="width: 300px; padding: 20px; cursor: pointer; background: #0071bd; color: #ffff; border-radius: 10px; border: 1px solid #999; font-size: 150%;" type="button" value="BOOK CALL" onclick="window.location.href='https://m.me/1673844402720379?ref=w5135092'" /> </form> Michelle |
pandy |
Mar 12 2019, 08:19 PM
Post
#2
|
🌟Computer says no🌟 Group: WDG Moderators Posts: 20,730 Joined: 9-August 06 Member No.: 6 |
Center the text on the button or center the button on the page?
http://www.w3.org/Style/Examples/007/center.html To open a new window you need window.open(), not location.href . https://developer.mozilla.org/en-US/docs/Web/API/Window/open |
magnus1 |
Mar 12 2019, 10:18 PM
Post
#3
|
Group: Members Posts: 6 Joined: 20-November 16 Member No.: 24,935 |
Center the text on the button or center the button on the page? http://www.w3.org/Style/Examples/007/center.html To open a new window you need window.open(), not location.href . https://developer.mozilla.org/en-US/docs/Web/API/Window/open Thanks so much for replying! Yep, within the button. So how do I incorporate this new html into my current code? I barely touch html if I can help it! Scares me! |
Lo-Fi Version | Time is now: 18th April 2024 - 12:46 PM |