I wanted to make these two buttons here but I doubt to use the tag button or the , which better to use?

Asked

Viewed 30 times

0

I’m just using html and css on this site, follow the photo of the buttons : https://prnt.sc/1gkoqf7

.bannerContainer {
  background-image: url(../img/banner-barbearia.jpg);
  background-repeat: no-repeat;
  background-size: cover;
  height: 55rem;
  text-align: center;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.bannerTitulo {
  color: #f2f2f2;
  font-size: 4.5rem;
  font-weight: 400;
}

.bannerP {
  color: #f2f2f2;
  margin: 0;
}
<section class="banner">
  <div class="bannerContainer">
    <h2 class="bannerTitulo">Transformando homens em astros</h2>
    <p class="bannerP"> A experiência completa da melhor barbearia de Curitiba.</p>
    <p class="bannerP">A melhor versão da sua barba e cabelo</p>

  </div>
</section>

  • it will be better to use the tag <a> in terms of CEO. The <a> may be within a <div>

  • 1

    think of the semantics: <a> is a link, for navigation, <button> is an action, do something on the page (validate, send, etc), think about what you need to do and use the most correct element semantically

  • Thanks for the answers!! I’m starting now to be a dev front end, it’s been 3 months since I started but I’m doing this site from scratch and the doubts come to light :(

  • In the element documentation <a> shows cases of semantic tag abuse, a look.

1 answer

0

An alternative is to use the tag button next to the formaction attribute, formaction is an attribute that you can put the URL as the value within it, so you can use the button and provide the url for the formaction attribute, so when the user clicks on the button it will be forwarded to the link that was provided.

syntax: ''' '''

you can read more about on the website: https://www.w3schools.com/tags/att_button_formaction.asp

  • SYNTAX: <button type="Submit" formaction="URL"> *

Browser other questions tagged

You are not signed in. Login or sign up in order to post.