• 10 heures
  • Facile

Ce cours est visible gratuitement en ligne.

course.header.alt.is_video

course.header.alt.is_certifying

J'ai tout compris !

Mis à jour le 13/03/2023

Understand elements as boxes

Compétences évaluées

  • Define the components of the box model and how they are used in layouts
  • Adjust element properties to achieve a desired appearance
  • Question 1

    The following CSS properties all affect an element's appearance in a layout:

    Attention, plusieurs réponses sont possibles.
    • padding

    • border

    • structure

    • margin

  • Question 2

    Padding lives:

    • inside an element's border

    • outside an element's border

    • inside an element's border and includes the border 

    • inside as well as outside the element's border, depending on your needs

  • Question 3

    Which line of code could you write to achieve this result?

    • p {
        background-color: salmon;
        color: white;
        width: 100px;
        border: 1px solid black;
      }
      
    • p {
        background-color: salmon;
        color: white;
        width: 100px;
        text-align: center;
        padding: 10px;
        border-radius: 5px;
      }
      
    • p {
        background-color: salmon;
        color: white;
        width: 100px;
        margin: 80px;
      }
      
    • p {
        background-color: salmon;
        color: white;
        width: 100px;
        padding: 300px auto;
        margin: 100px;
        border: 10px double black;
      }
      
Et si vous obteniez un diplôme OpenClassrooms ?
  • Formations jusqu’à 100 % financées
  • Date de début flexible
  • Projets professionnalisants
  • Mentorat individuel
Trouvez la formation et le financement faits pour vous