0

That's my first try:

.pricingTable-firstTable_table__getstart {
  color: white;
  background-color: #71ce73;
  margin-top: 30px;
  border-radius: 5px;
  cursor: pointer;
  padding: 15px;
  box-shadow: 0px 3px 0px 0px #66ac64;
  letter-spacing: 0.07em;
  transition: all 0.4s ease;
}
<div class="pricingTable-firstTable_table__getstart" href="https://website.com">JOIN</div>

It doesn't click, and doesn't change anything, I appreciate the help

6
  • 1
    You want the div on clicking to go to the href you specified? Commented Oct 15, 2019 at 7:54
  • 1
    you need to use an anchor tag Commented Oct 15, 2019 at 7:55
  • 1
    @Martin, correct, Im not a devoloper but I get the logic, :) Commented Oct 15, 2019 at 7:58
  • 1
    @Pete I dont want a hyperlink, it ruins the button Commented Oct 15, 2019 at 7:59
  • 1
    You should use the correct elements and learn how to style them properly - add display:inline-block to your styles Commented Oct 15, 2019 at 7:59

2 Answers 2

2

The usual way to achieve this is wrapping your div inside an a tag:

<a href="https://website.com">
    <div class="pricingTable-firstTable_table__getstart">JOIN</div>
</a>

You could also solve this (less elegantly imo) using an onclick event in JavaScript:

<div class="pricingTable-firstTable_table__getstart" onclick="window.location.href='https://website.com';">JOIN</div>
Sign up to request clarification or add additional context in comments.

Comments

1

If you want an anchor link to look like a button. Style it something like this:

Css

.link-button {
  padding: 5px 10px 5px 10px;
  border: 1px solid blue;
  background-color: lightblue;
}

.link-button:hover {
  background-color: blue;
  cursor: pointer;
}

And the markup

<a class="link-button">Anchor as button</a>

But I prefer to use buttons for operations, and show navigation as anchors. Because people recognize them for that.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.