El atributo id y el atributo class
<style>
<body>
<p>This is a paragraph.</p>
</body>
Prueba atributo id
Atributo id
<!DOCTYPE html>
<html>
<style>
p#p01 {
color: blue;
}
</style>
<body>
<p>This is a paragraph.</p>
<p>This is a paragraph.</p>
<p>This is a paragraph.</p>
<p id="p01">I am different.</p>
</body>
</html>
This is a paragraph.
This is a paragraph.
This is a paragraph.
I am different.
Atributo class
<!DOCTYPE html>
<html>
<style>
p.error {
color: red;
}
</style>
<body>
<p>parrafo.</p>
<p>parrafo.</p>
<p class="error">Soy rojo.</p>
<p>parrafo.</p>
<p class="error">Yo tambien soy rojo.</p>
</body>
</html>
<html>
<style>
p.error {
color: red;
}
</style>
<body>
<p>parrafo.</p>
<p>parrafo.</p>
<p class="error">Soy rojo.</p>
<p>parrafo.</p>
<p class="error">Yo tambien soy rojo.</p>
</body>
</html>
parrafo.
parrafo.
Soy rojo.
parrafo.
Yo tambien soy rojo.
Prueba atributo class
No hay comentarios:
Publicar un comentario