style
Todos los elementos pueden definir su propio estilo usando el atributo
style
.
Las propiedades colocadas en este atributo sustituyen a los valores definidos en otros lados.
1 | <!DOCTYPE html> |
2 | <html lang="es"> |
3 | |
4 | <head> |
5 | <meta charset="UTF-8"> |
6 | <meta name="viewport" |
7 | content="width=device-width"> |
8 | <title>Atrinuto style</title> |
9 | <style> |
10 | p { |
11 | color: olive; |
12 | font-style: italic; |
13 | } |
14 | </style> |
15 | </head> |
16 | |
17 | <body> |
18 | <p style="color: yellow; |
19 | background-color: blue"> |
20 | Párrafo de letra amarilla y fondo |
21 | azul. |
22 | </p> |
23 | <p>Párrafo normal.</p> |
24 | </body> |
25 | |
26 | </html> |