Docsity

(Intermediate HTML & CSS) Advanced Grid Properties Knowledge Assessment Guide 2024, Exams of Programming Languages

Partial preview of the text

Download (Intermediate HTML & CSS) Advanced Grid Properties Knowledge Assessment Guide 2024 and more Exams Programming Languages in PDF only on Docsity!

INTERMEDIATE HTML & CSS

Advanced Grid Properties

KNOWLEDGE ASSESSMENT GUIDE

  1. Which CSS property defines the number of columns in a grid layout?
    • a) grid-template-rows
    • b) grid-template-columns
    • c) grid-column-gap
    • d) grid-auto-flow
    • Answer: b) grid-template-columns
    • Rationale: The grid-template-columns property specifies the number and size of columns in a grid layout.
  2. What does the grid-auto-flow property control?
    • a) The placement of grid items
    • b) The size of grid items
    • c) The gap between grid items
    • d) The alignment of grid items
    • Answer: a) The placement of grid items
    • Rationale: The grid-auto-flow property controls how auto-placed items are inserted in the grid.
  3. Which value of the grid-template-areas property is used to define a grid area that spans multiple cells?
    • a) span
    • b) repeat

Fill-in-the-Blank Questions

  1. The __________ property specifies the size of the gaps between columns in a grid layout.
    • Answer: grid-column-gap
    • Rationale: The grid-column-gap property sets the size of the gaps between columns.
  2. To create a grid container, you need to set the display property to __________.
    • Answer: grid
    • Rationale: Setting the display property to grid makes an element a grid container.
  3. The __________ property defines the number and size of rows in a grid layout.
    • Answer: grid-template-rows
    • Rationale: The grid-template-rows property specifies the number and size of rows in a grid layout.
  4. The __________ property is used to align grid items along the row axis.
    • Answer: justify-items
  • Rationale: The justify-items property aligns grid items along the row axis.
  1. The __________ property is used to align grid items along the column axis.
  • Answer: align-items
  • Rationale: The align-items property aligns grid items along the column axis.

True/False Questions

  1. The grid-template-areas property allows you to name grid areas and place items in those areas.
  • Answer: True
  • Rationale: The grid-template-areas property allows you to define named grid areas and place items in those areas.
  1. The grid-auto-columns property specifies the size of implicitly created columns.
  • Answer: True
  • Rationale: The grid-auto-columns property sets the size of columns that are created automatically.
  1. The grid-template property is a shorthand for setting grid-template- rows, grid-template-columns, and grid-template-areas.
  • Answer: c) align-items
  • Rationale: The align-items property controls the alignment of grid items along the block axis.
  1. What does the grid-area property do?
  • a) Defines the size of the grid container
  • b) Specifies the start and end positions of a grid item
  • c) Sets the gap between grid items
  • d) Aligns grid items within their cells
  • Answer: b) Specifies the start and end positions of a grid item
  • Rationale: The grid-area property specifies the start and end positions of a grid item within the grid.
  1. Which value of the grid-auto-flow property places items in the densest possible way?
  • a) row
  • b) column
  • c) dense
  • d) sparse
  • Answer: c) dense
  • Rationale: The dense value of grid-auto-flow places items in the densest possible way, filling gaps.
  1. The grid-template-columns property can use which of the following units?
    • a) px
    • b) fr
    • c) %
    • d) All of the above
    • Answer: d) All of the above
    • Rationale: The grid-template-columns property can use various units like px, fr, and %.
  2. Which property is used to set the gap between both rows and columns in a grid layout?
    • a) grid-gap
    • b) gap
    • c) grid-row-gap
    • d) grid-column-gap
    • Answer: b) gap
    • Rationale: The gap property is a shorthand for setting the gaps between both rows and columns in a grid layout.

Correct Answer: True

Rationale: Grid items can indeed span across multiple rows and columns simultaneously, allowing for flexible and dynamic layouts in CSS grid. Multiple Choice: Which CSS property is used to set the alignment of grid items within a grid container? A. justify-items B. align-content C. grid-align D. item-align

Correct Answer: A. justify-items

Rationale: The justify-items property is used to set the alignment of grid items along the inline (row) axis within a grid container. Fill-in-the-Blank: The grid-area property can be used to define a grid item's size, position, and __ within the grid.

Correct Answer: name

Rationale: In addition to specifying size and position, the grid-area property can also assign a name to a grid item, enhancing readability and maintainability. True/False: Grid lines in CSS Grid are numbered starting from 1 at the top left corner of the grid.

Correct Answer: True

Rationale: Grid lines are indeed numbered starting from 1 at the top left corner of the grid, making it easier to reference specific areas within the layout. Multiple Choice: Which CSS function is used to repeat track sizing in a grid layout? A. track-repeat B. repeat() C. grid-repeat D. auto-fill

Correct Answer: B. repeat()

Rationale: The repeat() function in CSS is specifically designed to simplify the repetition of track sizing values in grid layouts, reducing redundancy and improving efficiency.

Correct Answer: A. grid-gap

Rationale: The grid-gap property is specifically designed to create spaces between grid items in a grid container, improving readability and visual separation. Fill-in-the-Blank: The fr unit in CSS Grid stands for _ and is used to define _ within a grid layout.

Correct Answer: fraction, flexible units

Rationale: The fr unit represents a fraction of available space within a grid layout, allowing for flexible and responsive design without relying on fixed units. True/False: Grid containers in CSS Grid can be nested to create complex layouts.

Correct Answer: True

Rationale: Grid containers can indeed be nested within each other in CSS Grid, enabling developers to create intricate and sophisticated layouts with multiple levels of grids.

Multiple Choice: Which CSS property is used to set the alignment of grid lines within a grid container? A. justify-content B. align-items C. grid-align D. line-align

Correct Answer: B. align-items

Rationale: The align-items property is used to align grid lines along the block (column) axis within a grid container, ensuring consistent positioning of grid items. Fill-in-the-Blank: The grid-template-rows property is used to define the height of rows in a grid container. It accepts values in the format __.

Correct Answer: length, percentage, or auto

Rationale: Developers can specify the height of rows in a grid container using values in the format of length, percentage, or the 'auto' keyword for automatic sizing. True/False: The minmax() function in CSS Grid allows developers to specify a minimum and maximum size range for grid tracks.

Rationale: By specifying values in the format of length or percentage, developers can precisely control the spacing between columns in a grid layout, enhancing the overall design. True/False: Named grid lines in CSS Grid can only be referenced within the same grid container.

Correct Answer: False

Rationale: Named grid lines can be referenced across different grid containers in CSS Grid, providing flexibility and modularity in designing complex layouts. Multiple Choice: Which CSS property is used to create an implicit grid in a grid container when grid items exceed the specified grid tracks? A. grid-auto-columns B. auto-grid C. grid-auto-flow D. implicit-grid

Correct Answer: C. grid-auto-flow

Rationale: By using the grid-auto-flow property, developers can automatically generate additional grid tracks in a grid container to accommodate excess grid items, ensuring a fluid and adaptable layout.

Fill-in-the-Blank: The grid-gap property is a shorthand for setting the row- gap and __ in a grid layout.

Correct Answer: column-gap

Rationale: By using the grid-gap property, developers can conveniently set both row-gap and column-gap values simultaneously, streamlining the process of creating well-structured grid layouts.

  1. Multiple Choice: What property is used to control the alignment of grid items along the block axis in CSS Grid Layout? A) justify-content B) align-items C) justify-items D) align-content

Correct Answer: B) align-items

Rationale: The align-items property in CSS Grid Layout is used to control the vertical alignment of grid items along the block axis.

Correct Answer: B) grid-template-columns

Rationale: The grid-template-columns property in CSS Grid Layout is used to specify the sizes of columns in a grid container using a track list.

  1. Fill-in-the-Blank: The default value for the grid-auto-flow property in CSS Grid Layout is _____.

Correct Answer: row

Rationale: By default, the grid-auto-flow property in CSS Grid Layout is set to "row", meaning grid items will be placed in rows.

  1. True/False: The justify-self property in CSS Grid Layout is used to align grid items within their respective grid tracks along the inline axis.

Correct Answer: True

Rationale: The justify-self property in CSS Grid Layout is used to align grid items within their individual grid tracks along the inline axis.

  1. Multiple Choice: Which CSS property defines the size of the gutters between rows and columns in a grid layout?

A) gutter-size B) grid-gap C) gutter-gap D) column-row-gap

Correct Answer: B) grid-gap

Rationale: The grid-gap property in CSS Grid Layout is used to define the size of the gutters between rows and columns in a grid layout.

  1. Fill-in-the-Blank: The align-content property in CSS Grid Layout is used to align multiple _____ axes within the grid container.

Correct Answer: block

Rationale: The align-content property in CSS Grid Layout is used to align multiple block axes within the grid container.

  1. True/False: Grid lines in CSS Grid Layout can be explicitly named using the grid-template-rows and grid-template-columns properties.

Correct Answer: True