• 10 hours
  • Easy

Free online content available in this course.

course.header.alt.is_video

course.header.alt.is_certifying

Got it!

Last updated on 3/13/23

Understand elements as boxes

Evaluated skills

  • 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:

    Careful, there are several correct answers.
    • 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;
      }
      
Ever considered an OpenClassrooms diploma?
  • Up to 100% of your training program funded
  • Flexible start date
  • Career-focused projects
  • Individual mentoring
Find the training program and funding option that suits you best