{ "$schema": "../schemas/code-crispies-module-schema.json", "id": "html-progress-meter", "title": "Progress & Meter Elements", "description": "Display completion status and scalar measurements natively", "mode": "html", "difficulty": "beginner", "lessons": [ { "id": "progress-basic", "title": "Progress Bars", "description": "The <progress> element shows task completion. Use value for current progress and max for the total.

The text inside is fallback for older browsers.", "task": "Create a progress bar showing 70% completion:
1. Add a <label> saying 'Download:'
2. Add a <progress> with value=\"70\" and max=\"100\"", "previewHTML": "", "previewBaseCSS": "body { font-family: system-ui; padding: 20px; } label { display: block; margin-bottom: 8px; font-weight: 500; } progress { width: 100%; height: 20px; border-radius: 10px; } progress::-webkit-progress-bar { background: #e0e0e0; border-radius: 10px; } progress::-webkit-progress-value { background: linear-gradient(90deg, #4caf50, #8bc34a); border-radius: 10px; } progress::-moz-progress-bar { background: linear-gradient(90deg, #4caf50, #8bc34a); border-radius: 10px; }", "sandboxCSS": "", "initialCode": "", "solution": "\n70%", "previewContainer": "preview-area", "validations": [ { "type": "element_exists", "value": "progress", "message": "Add a element" }, { "type": "attribute_value", "value": { "selector": "progress", "attr": "value", "value": "70" }, "message": "Set value=\"70\" on the progress element" }, { "type": "attribute_value", "value": { "selector": "progress", "attr": "max", "value": "100" }, "message": "Set max=\"100\" on the progress element" }, { "type": "element_exists", "value": "label", "message": "Add a