Contoh Membuat Border dengan CSS

<!doctype html>
<html>
<head>
   <title>Contoh Penggunaan Font</title>
</head>
<body>
<div id="contoh">Border merupakan hal yang penting pada CSS, jadi pahamilah.</div>

<form onsubmit="return false" name="fr">
<b>Edit Border: </b><br />
<select name="tipe">
<option value="solid">Solid</option>
<option value="double">Double</option>
<option value="ridge">Ridge</option>
<option value="inset">Inset</option>
<option value="outset">outset</option>
<option value="none">none</option>
</select>
 <input type="text" name="ukuran" value="5" /> (px)
 <input type="text" name="warna" value="red" />
 <button type="button" onclick="terapkan()">Terapkan</button>
</form>
<script type="text/javascript">
var el = document.getElementById('contoh');
function terapkan(){
    el.style.border = document.fr.tipe.value + ' ' + document.fr.ukuran.value + 'px ' + document.fr.warna.value;
    return el.style.border;
}</script>
</body>
</html>

Sumber : http://www.developer-id.com/