Di bawah ini kita akan mempelajari cara membuat divideryang berbeda dengan CSS.
<!DOCTYPE html> <html> <meta name="viewport" content="width=device-width, initial-scale=1"> <head> <style> body { font-family: Arial, Helvetica, sans-serif; } /* Dashed border */hr.dashed { border-top: 3px dashed #bbb; } /* Dotted border */hr.dotted { border-top: 3px dotted #bbb; } /* Solid border */hr.solid { border-top: 3px solid #bbb; } /* Rounded border */hr.rounded { border-top: 8px solid #bbb; border-radius: 5px; } </style> </head> <body> <h2>Jenis divider yang berbeda</h2> <p>Dashed</p> <hr class="dashed"> <p>Dotted</p> <hr class="dotted"> <p>Solid</p> <hr class="solid"> <p>Rounded</p> <hr class="rounded"> </body> </html>
Langkah 1) Tambahkan HTML:
Contoh
<hr class="dashed"> <hr class="dotted"> <hr class="solid"> <hr class="rounded">
Langkah 2) Tambahkan CSS:
Contoh
/* Dashed border */hr.dashed { border-top: 3px dashed #bbb; } /* Dotted border */hr.dotted { border-top: 3px dotted #bbb; } /* Solid border */hr.solid { border-top: 3px solid #bbb; } /* Rounded border */hr.rounded { border-top: 8px solid #bbb; border-radius: 5px; }