Button isnt working


#1

i tried everything i’m trying to make my button align center and for it to actually show up as a button but it just shows up as a link. but it wont work someone please tell me what i’m doing wrong. thanks :slight_smile:.

here is my html:

<div class="button">
<a href="aboutus.html">About Us</a>
</div>

and my css:

button {
  border-color: #FFFFFF;
     background-color: #1c5a68;
     border-style: 20px;
     border-width: 2px;
     border-radius: 5px;
     margin: auto;
     text-align: center;
     text-decoration: none;
     color: #FFFFFF;
     font-family: sans-serif;
     text-align: center;
}

#2

the button css selector will target the <button></button> element, which you do not have.

if you want to target the class, use .button

also, why not simple make the anchor element (<a></a>) a block? This way, the whole thing is clickable, not just the text


#3

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.