Skip to content

Instantly share code, notes, and snippets.

@teffcode
Last active May 27, 2021 16:08
Show Gist options
  • Select an option

  • Save teffcode/279d09730612178616d0428fde1fbb3a to your computer and use it in GitHub Desktop.

Select an option

Save teffcode/279d09730612178616d0428fde1fbb3a to your computer and use it in GitHub Desktop.

馃憢馃徏 Welcome 馃憢馃徏

Quiz banner

Instagram | Twitter | LinkedIn


Choose your language 馃憛



English version 馃殌


Which of the following line-height values will achieve the p element have a 32px of height ?


Click here to see the correct answer and explanation 馃憖
Correct Answer Explanation
A and B The line-height CSS property sets the height of a line box. The used value (2) is multiplied by the element's own font size (16px). For this reason, the correct answer is 2 (2 * 16 = 32).

Explanation based on 馃憠馃徏 line-height | MDN

Code:

HTML:

<p>I'm a paragraph</p>

CSS:

p {
  line-height: 2;
  background: skyblue;
}


Spanish version 馃殌


驴Cu谩l de los siguientes valores de line-height lograr谩 que el elemento p tenga una altura de 32px?


Haz click aqu铆 para ver la respuesta correcta y su explicaci贸n 馃憖
Respuesta correcta Explicaci贸n
A y B La propiedad de CSS line-height establece la altura de una casilla remarcada por l铆neas (aunque com煤nmente se usa para establecer la distancia entre l铆neas de texto). En este caso, el valor de line-height 2 es multiplicado por el tama帽o de fuente propio del elemento p (16px). Por esta raz贸n, la respuesta correcta es 2, ya que 2 * 16 = 32. Tambi茅n, si el valor de line-height es en longitud (como 32px), este se utiliza en el c谩lculo de la altura de la casilla encuadrada por l铆neas.

Explicaci贸n basada en 馃憠馃徏 line-height | MDN

C贸digo completo:

HTML:

<p>I'm a paragraph</p>

CSS:

p {
  line-height: 2;
  background: skyblue;
}


Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment