DigiSkill — Free CSS Training https://www.digiskill.live/training/css/ The linked CSS exercise checks exactly three declarations in one .card rule. These four lessons build toward that same activity. The checker does not apply your code to the website or implement all CSS behaviour. 1. Read a CSS rule Connect a selector to the elements it should style. Understand the idea A CSS rule combines a selector with declarations inside braces. The selector identifies which elements should be styled. A declaration pairs a property with a value, separated by a colon. A class selector starts with a dot, such as .card for elements with the card class. Work through it Choose the intended element or class first. Add a property and value inside braces, then separate declarations with semicolons. Check spelling carefully: an unrecognised property or the wrong selector can prevent a style from applying. The practice exercise specifically asks for one .card rule. Worked example .card { padding: 16px; } The selector targets a class named card. The declaration adds inner space. This is a teaching example; the full exercise asks for three specific properties and values. Common mistakes: - Forgetting the dot before a class name. - Mixing up colons and semicolons. - Writing declarations outside the braces. Practice: https://www.digiskill.live/practice/css-card-style/ Reference: https://developer.mozilla.org/en-US/docs/Learn_web_development/Core/Styling_basics/Basic_selectors — 2. Set a background colour Identify the property and an appropriate colour value. Understand the idea The background-color property sets an element’s background colour. Hexadecimal notation is one way to represent a colour. A background is only one part of readable design: text must remain legible against it, and colour alone should not be the only way to communicate important information. Work through it Use a valid colour value and check the relevant property name. Keep the selector appropriate to the element. For the exercise, use the exact requested hexadecimal value; a different colour can be valid CSS but still fail a specific brief. Worked example .card { background-color: #f2f6fc; } The declaration sets a pale background for the selected class. The example colour differs from the practice requirement so you must read and apply that requirement deliberately. Common mistakes: - Using the text colour property when a background is requested. - Omitting the # from this hex notation. - Choosing appearance without checking text readability. Practice: https://www.digiskill.live/practice/css-card-style/ Reference: https://developer.mozilla.org/en-US/docs/Learn_web_development/Getting_started/Your_first_website/Styling_the_content — 3. Add inner space with padding Distinguish space inside an element from space outside it. Understand the idea Padding is space between an element’s content and its border area. Margin is space outside the border. They can affect a layout in different ways. A single padding value applies to all four sides, which is useful for a small card that needs even inner spacing. Work through it Decide whether the problem is crowded content inside the card or distance between neighbouring cards. Use padding for the inner gap in this lesson. Include a unit where required and inspect small screens as well as wide ones. The practice checker compares the requested declaration rather than rendering a complete layout. Worked example .card { padding: 20px; } This adds 20 pixels of padding on every side. The content gets room inside its container. This is different from pushing the entire card away from neighbouring elements with margin. Use the exercise’s requested amount when practising. Common mistakes: - Using margin when the brief asks for inner spacing. - Writing a nonzero length without the required unit. - Assuming a desktop layout will fit every phone. Practice: https://www.digiskill.live/practice/css-card-style/ Reference: https://developer.mozilla.org/en-US/docs/Learn_web_development/Getting_started/Your_first_website/Styling_the_content — 4. Combine a card’s styles Use border-radius and review the whole rule. Understand the idea Border-radius rounds the corners of an element’s border box. It is independent of padding and background colour, so you can combine those properties in a single rule. Clear, minimal rules are easier to compare with a brief than a large collection of unrelated declarations. Work through it Write one .card selector, then add the three requested declarations. Read the property names and values one by one. Check braces, colons, semicolons and units. The DigiSkill activity deliberately supports a focused rule; passing it does not test every browser, accessibility requirement or responsive design concern. Worked example .card { background-color: #f2f6fc; padding: 20px; border-radius: 12px; } The three declarations have different jobs: background, inner spacing and rounded corners. The exercise uses its own exact values, so adapt the idea to the specification. Common mistakes: - Using a border width in place of a corner radius. - Forgetting one of the three requested declarations. - Assuming a focused syntax check is a full visual test. Practice: https://www.digiskill.live/practice/css-card-style/ Reference: https://developer.mozilla.org/en-US/docs/Learn_web_development/Core/Styling_basics/Backgrounds_and_borders —