
Show answerHide answer
Correct answer: A Option A
Explanation
Explanation:📌 Requirements Recap:
Mobile devices: Show three rows (i.e., each item spans full width: size="12").
Desktops and tablets: Show a single row (i.e., each item should span 4 columns out of 12, so 3 items side-by-side).
âś… Why Option A Is Correct:
In Option A, each
lightning:layoutitem size="12" mediumdevicesize="4" largedevicesize="4"
size="12" → Full width on mobile (3 rows ✅)
mediumDeviceSize="4" and largeDeviceSize="4" → One-third width on tablets/desktops (3 items in 1 row ✅)
This meets both requirements perfectly.
❌ Why the Others Are Incorrect:
Option B: Uses size="12" for all devices → All items show as full-width on all screen sizes (3 rows everywhere ❌)
Option C: Only sets largeDeviceSize="4" and omits mediumDeviceSize → Works on desktop, but not tablets (tablets still show 3 rows ❌)
Option D: Has incorrect nesting and inconsistent sizing logic — it's also not semantically clean and fails to guarantee both requirements ❌
Reference:
Salesforce Lightning Layout Documentation