Single Choice Question

  1. The unit which is the most accurate unit for the width of an element is:
    1. em
    2. px
    3. %
    4. pt
  2. The unit which is an absolute unit for element is:
    1. em
    2. px
    3. %
    4. rem
  3. The unit represents a percentage of the viewport's width is
    1. vw
    2. vh
    3. vmin
    4. vmax
  4. Attribute that can be used to set the height of line for an element is
    1. line-height
    2. height
    3. width
    4. margin
  5. Attribute that can be used to set the space between the border and the content of an element is
    1. padding
    2. margin
    3. space-between
    4. border
  6. Style "padding: 25px 50px 75px;" means
    1. top: 25px; right: 50px; bottom: 75px; left: 50px;
    2. top: 25px; right: 50px; bottom: 75px; left: 25px;
    3. top: 25px; right: 75px; bottom: 50px; left: 25px;
    4. top: 50px; right: 75px; bottom: 25px; left: 25px;
  7. Style "margin: 25px 50px 75px 100px;" means
    1. top: 25px; right: 50px; bottom: 75px; left: 100px;
    2. top: 25px; right: 75px; bottom: 50px; left: 100px;
    3. top: 50px; right: 75px; bottom: 25px; left: 100px;
    4. top: 75px; right: 50px; bottom: 25px; left: 100px;
  8. Style "border: 5px solid #00ff00;" means
    1. Element has a solid green border with a thickness of 5 pixels.
    2. Element has a solid red border with a thickness of 5 pixels.
    3. Element has a dashed green border with a thickness of 5 pixels.
    4. Element has a dashed red border with a thickness of 5 pixels.
  9. If we want the browser calculates a suitable width for the element, we may use
    1. width: auto;
    2. width: initial;
    3. width: 100%;
    4. width: suitable;
  10. Which property in CSS is used to set the minimum width of an element's content area?
    1. width
    2. max-width
    3. min-width
    4. margin
  11. About box model, which following statement is correct
    1. The width of an element is the width of the content area plus the padding plus the border.
    2. The width of an element is the width of the content area plus the padding plus the border plus the margin.
    3. The width of an element is the width of the content area plus the padding plus the border plus the margin plus the border.
    4. The width of an element is the width of the content area plus the padding plus the border plus the margin plus the border plus the margin.
  12. About length unit, which following statement is wrong
    1. The em unit is relative to the font size of the root element.
    2. The most commonly used absolute length unit is px (pixels).
    3. If you wish to create an inclusive app, it is best to avoid absolute length units as they are not accessible.
    4. The percentage unit is relative to the width of the parent element.

True or False Question

  1. The em is a relative length unit.
  2. The px is a relative length unit.
  3. Relative units are fixed-size units that do not change based on other elements, such as pixels (px)
  4. If you wish to create an inclusive app, it is best to avoid absolute length units as they are not accessible.
  5. Unit em is relative to the font size of the parent element, while rem is relative to the font size of the root element.
  6. Vw is a viewport height unit.
  7. Padding is the space between the content and the border.
  8. Margin is the space between the border and the content.

Definition of Term

  1. Absolute length unit
  2. Relative length unit
  3. Box model
  4. Padding
  5. Margin

Short Answer

  1. Try to explain the difference between margin and padding attribute of style.
  2. Compare the absolute length unit and relative length unit.
  3. Explain how to calculate the size of one box model.
  4. Try to compare the em and rem
  5. Try to compare the em and %