1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52
|
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>Page Title</title>
<style type='text/css'>
#container { background-color: orange; zoom: 1; }
</style>
<script type='text/javascript'>
function Arrondi(element, rayon, couleur) {
element.style.position = 'relative';
var e;
for(var i=0;i<rayon;i++) {
var n = rayon - Math.floor(rayon * Math.sin(Math.acos((rayon-i)/rayon)));
e = this.trait(n, couleur);
e.style.top = i + 'px';
e.style.left = 0;
element.appendChild(e);
e = this.trait(n, couleur);
e.style.top = i + 'px';
e.style.right = 0;
element.appendChild(e);
e = this.trait(n, couleur);
e.style.bottom = i + 'px';
e.style.left = 0;
element.appendChild(e);
e = this.trait(n, couleur);
e.style.bottom = i + 'px';
e.style.right = 0;
element.appendChild(e);
}
}
Arrondi.prototype.trait = function(largeur, couleur) {
var e = document.createElement('div');
e.style.backgroundColor = couleur;
e.style.position = 'absolute';
e.style.width = largeur + 'px';
e.style.height = '1px';
e.style.overflow = 'hidden';
e.style.fontSize = '0';
return e;
}
</script>
</head><body onload='new Arrondi(document.getElementById("container"), 14, "white");'>
<div id='container'>
<h1>Un titre</h1>
<p>du texte du texte du texte du texte du texte du texte du texte du texte </p>
</div>
</body></html> |
Partager