freeCodeCamp/curriculum/challenges/spanish/01-responsive-web-design/css-flexbox/use-the-flex-grow-property-...

2.1 KiB

id title challengeType videoUrl localeTitle
587d78ae367417b2b2512afc Use the flex-grow Property to Expand Items 0 Utilice la propiedad flex-grow para expandir elementos

Description

Lo opuesto a flex-shrink es la propiedad de flex-grow . Recuerde que flex-shrink controla el tamaño de los elementos cuando el contenedor se reduce. La propiedad flex-grow controla el tamaño de los elementos cuando el contenedor principal se expande. Usando un ejemplo similar del último desafío, si un elemento tiene un valor de flex-grow de 1 y el otro tiene un valor de flex-grow de 3, el valor de 3 crecerá tres veces más que el otro.

Instructions

Agregue la propiedad CSS flex-grow a #box-1 y #box-2 . Dé a #box-1 un valor de 1 y #box-2 un valor de 2.

Tests

tests:
  - text: 'El elemento <code>#box-1</code> debe tener la propiedad <code>flex-grow</code> establecida en un valor de 1.'
    testString: 'assert($("#box-1").css("flex-grow") == "1", "The <code>#box-1</code> element should have the <code>flex-grow</code> property set to a value of 1.");'
  - text: 'El elemento <code>#box-2</code> debe tener la propiedad <code>flex-grow</code> establecida en un valor de 2.'
    testString: 'assert($("#box-2").css("flex-grow") == "2", "The <code>#box-2</code> element should have the <code>flex-grow</code> property set to a value of 2.");'

Challenge Seed

<style>
  #box-container {
    display: flex;
    height: 500px;
  }

  #box-1 {
    background-color: dodgerblue;
    height: 200px;

  }

  #box-2 {
    background-color: orangered;
    height: 200px;

  }
</style>

<div id="box-container">
  <div id="box-1"></div>
  <div id="box-2"></div>
</div>

Solution

// solution required