"Sono stato bocciato a parecchi esami. Un mio amico invece, li ha passati tutti a pieni voti. Ora è ingegnere e lavora in Microsoft. Io sono il proprietario."  - Bill Gates  •  "Se riesco a fare qualcosa in 10 minuti, è perché ho passato anni a studiarlo."  - Bill Gates  •  "Il vostro lavoro riempirà gran parte della vostra vita, e l'unico modo per essere veramente soddisfatti è fare ciò che ritenete sia un grande lavoro."  - Steve Jobs  •  "Siate affamati. Siate folli."  - Steve Jobs  •  

cinque 

ZERO

{CSS} Come inserire il codice css in html

home / css /

Lucio Paolo Asciolla

Senior Full Stack Developer

Esistono quattro modi di inserire codice css all'interno dei nostri documenti html:
1. CSS TRAMITE FILE ESTERNO
2. CSS INTERNO
3. CSS INTERNO CON @import
4. CSS IN LINEA

1. CSS tramite file esterno

<html>
<head>
<link href="stile.css" rel="stylesheet" type="text/css">
</head>
<body>
</body>
</html>

2. CSS Interno

<html>
<head>
<style type="text/css">
body {background: white;}
p {color: black;}
</style>
</head>
<body>
</body>
</html

3. CSS interno con @import

<html>
<head>
<style>
@import url(stile.css);
</style>
</head>
<body>
</body>
</html>

4. CSS in linea

<h1 style="color: red; background: black;">testo</h1>