{ "id": "basics", "title": "CSS Fundamentals", "description": "Establish a solid foundation in Cascading Style Sheets (CSS), the language used to control the presentation and layout of web documents. This module introduces core concepts that form the basis of modern web styling.", "difficulty": "beginner", "lessons": [ { "id": "basics-1", "title": "CSS Syntax Structure", "description": "CSS consists of selectors that target HTML elements and declaration blocks that specify how those elements should be styled. Understanding this fundamental syntax structure is essential for all CSS development.", "task": "Complete the CSS rule by adding a semicolon after the color property value. Every CSS declaration must end with a semicolon to separate it from the next declaration.", "previewHTML": "
This paragraph needs to be blue!
This paragraph should remain unchanged.
", "previewBaseCSS": "body { font-family: system-ui, -apple-system, sans-serif; padding: 1.25rem; }", "sandboxCSS": ".target { outline: 0.125rem dashed #ccc; padding: 0.625rem; }", "codePrefix": "/* Complete the CSS rule by adding a semicolon */\n.target {\n color: blue", "initialCode": "", "codeSuffix": "\n}", "previewContainer": "preview-area", "validations": [ { "type": "contains", "value": ";", "message": "Make sure to add a semicolon after the color value", "options": { "caseSensitive": true } } ] }, { "id": "basics-2", "title": "CSS Selectors: Classes", "description": "Class selectors allow you to target specific HTML elements that share the same class attribute. Classes are denoted by a dot (.) followed by the class name and are one of the most frequently used selectors in CSS.", "task": "Write a class selector to target elements with the class 'highlight'. Then, set their text color to 'crimson'. Begin with the dot (.) followed by the class name.", "previewHTML": "This text should be crimson.
This text remains unchanged.
", "previewBaseCSS": "body { font-family: system-ui, -apple-system, sans-serif; padding: 1.25rem; }", "sandboxCSS": ".highlight { background-color: #fffacd; padding: 0.3125rem; }", "codePrefix": "/* Write a class selector to target elements with the class 'highlight' */\n", "initialCode": "", "codeSuffix": " {\n color: crimson;\n}", "previewContainer": "preview-area", "validations": [ { "type": "contains", "value": ".highlight", "message": "Make sure to use the '.highlight' class selector", "options": { "caseSensitive": false } } ] }, { "id": "basics-3", "title": "Box Model: Adding Padding", "description": "The CSS box model consists of content, padding, border, and margin areas. Padding creates space between an element's content and its border, improving visual appearance and readability.", "task": "Add padding to the box element. Set the padding to '1.25rem' to create space between the content and the element's edges.", "previewHTML": "