8. display: block, inline and none
Este artículo se traducirá automáticamente. Por ahora se muestra en inglés.
display controls how an element takes space. block elements start on a new line and fill the width. inline elements sit in the text line and take only their content width. display: none removes the element from the page entirely.
Changing display is one of the most common layout tools.
Ver ejemplo
span {
display: block;
}
.hidden {
display: none;
}
✍️ Ahora te toca
Make the .badge class display inline-block with padding of 4px.