0

i recieved the following code for a button that i wanted to add on my Website. When i click on it it forwards me to the Website on the same Page but i want it to open a new tab with the Website (add "<" at start to try the code)+

Code in Image

<a 
  class="button" 
  style="
    background-color: #24baef; 
    color: #1c212e; 
    font-size: 14px; 
    font-weight: 600; 
    padding: 3.5px 17.5px; 
    border-radius: 5px;
  " 
  href="https://www.youtube.com/"
> 
  Button 
</a>

Best Regards, Danowick

biberman
  • 5,606
  • 4
  • 11
  • 35
  • 1
    Does this answer your question? [Open link in new tab or window](https://stackoverflow.com/questions/15551779/open-link-in-new-tab-or-window) – Elias Holzmann Jun 12 '21 at 18:39

1 Answers1

0

Use target attribute "_blank" inside of your anchor tag.

<a class="button" style=
"background-color: #24baef; 
color: #1c212e; 
font-size: 14px; 
font-weight: 600; 
padding: 3.5px 17.5px; 
border-radius: 5px;" 
href="https://youtube.com/" target="_blank">

For more reference:

https://developer.mozilla.org/en-US/docs/Web/HTML/Element/a https://www.w3schools.com/tags/att_a_target.asp