Skip to content

Instantly share code, notes, and snippets.

@manuelcanga
Created January 7, 2022 20:39
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save manuelcanga/1539dd5ce25203c253de181c32953c32 to your computer and use it in GitHub Desktop.
Save manuelcanga/1539dd5ce25203c253de181c32953c32 to your computer and use it in GitHub Desktop.
Elemento :before o :after no se visualiza

Si has añadido una regla :before o :after y parece que no toma los estilos es porque para que estos se necesita el atributo content aunque sea vacío. Es decir:

div.miclase:before {

  content: '';
}

otro ejemplo:

.help-tip::after {
    content: "";
    display: inline-block;
    cursor: pointer;
    width: 10px;
    height: 10px;
    background-repeat: no-repeat;
    background-image: url("/assets/small-help-icon.gif");
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment