What is the purpose of the 'display' property in CSS?
Instruction: Describe the 'display' property and its significance in CSS.
Context: This question assesses the candidate's understanding of how the 'display' property affects the layout of elements on a web page.
Updated
Official answer available
Read the opening below, then unlock the full answer and practical guidance.
display determines the boxes an element generates and their layout roles. It can describe an outer role in the parent's layout and an inner layout model for children. It does not change an element's HTML meaning.
<!doctype html> <html lang="en"> <head> <meta charset="utf-8"> <meta name="viewport" content="width=device-width, initial-scale=1"> <title>CSS example</title> <style> .bounded { display: block; width: 120px; border: 1px solid; } .inline-box { display: inline-block; width: 80px;...