Ask coding questions

← Back to all posts
Help me make this CSS button work
novaflippers (62)

I want this CSS button to actually work (When i click it, it redirects to a link). Code:

<center><button class="button"><span>Start</span></button></center>

.button {
  border-radius: 5px;
  background-color: #ededeb;
  color: #292222;
  text-align: center;
  font-size: 28px;
  padding: 25px;
  width: 220px;
  transition: all 0.5s;
  margin: 5px;
  font-size: 28px;
  font-family: 'Courier New', monospace;

.button span {
  cursor: pointer;
  display: inline-block;
  position: relative;
  transition: 0.5s;

.button span:after {
  content: '\00bb';
  position: absolute;
  opacity: 0;
  top: 0;
  right: -20px;
  transition: 0.5s;

.button:hover span {
  padding-right: 25px;

.button:hover span:after {
  opacity: 1;
  right: 0;
Answered by malvoliothegood (851) [earned 5 cycles]
View Answer