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
| <!DOCTYPE html>
<html lang="fr" dir="ltr">
<head>
<meta http-equiv="cache-control" content="public, max-age=60">
<meta charset="utf-8">
<meta name="viewport" content="initial-scale=1.0">
<meta name="author" content="Daniel Hagnoul">
<title>Test</title>
<link href="https://fonts.googleapis.com/css?family=Kaushan+Script" rel="stylesheet">
<!-- ??? http://style.com/cool ??? -->
<!-- <link rel="stylesheet" href="http://chemin/fichier.css"> -->
<style>
h1 {
color: blue;
}
.vert {
color: green;
font-family: 'Kaushan Script', cursive;
font-size: 2rem;
}
</style>
</head>
<body>
<h1>Un beau titre bleu</h1>
<p class="vert">Un paragraphe vert qui deviendra rouge dans trois secondes.</p>
<script>
/*
* Après 3 secondes, passe du vert au rouge
*/
setTimeout( function(){
document.querySelector( '.vert' ).style.color = 'red';
}, 3000 ); // 3s
</script>
</body>
</html> |
Partager