Skip to content

Instantly share code, notes, and snippets.

@furenku
Created November 1, 2021 14:29
Show Gist options
  • Select an option

  • Save furenku/45d9de02d207b2f5f9f03fcf7513e4be to your computer and use it in GitHub Desktop.

Select an option

Save furenku/45d9de02d207b2f5f9f03fcf7513e4be to your computer and use it in GitHub Desktop.
clase css
body {
/* bgc */
background-color: #ddd;
}
/* Selector por nombre de elemento */
h1 {
/* c */
color: red;
}
a {
/* c */
color: purple;
}
/* Selectores por clase */
.ejemplo {
/* w100 */
width: 100px;
/* h100 */
height: 100px;
/* bgc */
background-color: #fff;
/* m16 */
margin: 16px;
}
.caja {
/* w200 */
width: 200px;
/* h200 */
height: 200px;
/* bd */
border: 1px solid red;
}
.especial {
/* bgc */
background-color: #fa0;
}
/* Selector por id */
#uno {
/* p32 */
padding: 32px;
/* c */
color: purple;
/* bgc */
background-color: #fff;
/* fz32 */
font-size: 32px;
}
#dos {
/* p24 */
padding: 24px;
/* c */
color: green;
/* bgc */
background-color: #000;
/* fz18 */
font-size: 18px;
}
/* Selector por atributo */
[un-atributo=un-valor]{
/* bgc */
background-color: green;
}
[un-atributo=otro-valor]{
/* bgc */
background-color: yellow;
}
<!-- html:5 -->
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>CSS</title>
<!-- link -->
<link rel="stylesheet" href="estilos.css">
</head>
<body>
<!-- h1 -->
<h1>
CSS: Conceptos fundamentales
</h1>
<!-- a -->
<a href="#">
Un enlace
</a>
<!-- .ejemplo -->
<div class="ejemplo"></div>
<!-- .caja -->
<div class="caja"></div>
<!-- .ejemplo.caja -->
<div class="ejemplo caja"></div>
<!-- .ejemplo.caja.especial -->
<div class="ejemplo caja especial"></div>
<!-- #uno -->
<div id="uno">
Uno
</div>
<!-- #dos.caja -->
<div id="dos" class="caja">
Dos
</div>
<!-- .caja[un-atributo=un-valor] -->
<div class="caja" un-atributo="un-valor"></div>
<!-- .caja[un-atributo=otro-valor] -->
<div class="caja" un-atributo="otro-valor"></div>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment