How To

Cara Membuat Next dan Previous Button

Di bawah ini kita akan mempelajari cara membuat tombol “next” dan “previous” dengan CSS.

Next dan Previous Button

<!DOCTYPE html>
<html>
<head>
<meta name="viewport" content="width=device-width, initial-scale=1">
<style>
a {
  text-decoration: none;
  display: inline-block;
  padding: 8px 16px;
}

a:hover {
  background-color: #ddd;
  color: black;
}

.previous {
  background-color: #f1f1f1;
  color: black;
}

.next {
  background-color: #4CAF50;
  color: white;
}

.round {
  border-radius: 50%;
}
</style>
</head>
<body>

<h2>Contoh Previous and Next Buttons</h2>

<a href="#" class="previous">&laquo; Previous</a>
<a href="#" class="next">Next &raquo;</a>

<a href="#" class="previous round">‹</a>
<a href="#" class="next round">›</a>
  
</body>
</html> 

Cara Membuat Next dan Previous Button

Langkah 1) Tambahkan HTML:
Contoh

<a href="#" class="previous">&laquo; Previous</a>
<a href="#" class="next">Next &raquo;</a>

<a href="#" class="previous round">‹</a>
<a href="#" class="next round">›</a>

Langkah 2) Tambahkan CSS:
Contoh

a {
  text-decoration: none;
  display: inline-block;
  padding: 8px 16px;
}

a:hover {
  background-color: #ddd;
  color: black;
}

.previous {
  background-color: #f1f1f1;
  color: black;
}

.next {
  background-color: #4CAF50;
  color: white;
}

.round {
  border-radius: 50%;
}

Hanifah Nurbaeti