Exercice CSS : les unités

by Arnaud

HTML

<p>
<strong>Dans cet exercice, nous souhaitons que la boite parent fasse 500px de large, et que la boite enfant soit 2X moins large, avec une taille de police 2X plus grande.</strong>
<br />
Rappel :
<ul>
<li>Propriété CSS pour la largeur : width
</li>
<li>Propriété CSS pour la taille de police : font-size
</li></ul>
</p>


PX / EM / %

<div class="boiteParent">
Ceci est la boite parent.

<div class="boiteEnfant">
Ceci est la boite enfant.
</div>
</div>

CSS

.boiteParent {
  border:1px solid grey;
  font-size:12px;
background:rgb(255,114,125);
  width:500px;
}




.boiteEnfant {
border:1px solid grey;
width:50%;
background:rgba(0,0,0,0);

font-size:2em;
}