From 4dd12e973cd638851187512d0009e8afdc3ca0c9 Mon Sep 17 00:00:00 2001 From: Marie Malarme Date: Mon, 8 Mar 2021 12:00:55 +0000 Subject: [PATCH] class-that: add code examples to declare a class in css and attribute it to html elements --- subjects/class-that/README.md | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/subjects/class-that/README.md b/subjects/class-that/README.md index cc100557..7c57499f 100644 --- a/subjects/class-that/README.md +++ b/subjects/class-that/README.md @@ -20,6 +20,25 @@ Create the 3 following classes, setting them with the given rulesets, & attribut Note that you can attribute several classes to a same element ; create the class `body-member`, which set the `width` to 50 pixels and the `margin` to 30 pixels, and add it to the `class` attribute of those elements: `arm-left`, `arm-right`, `leg-left` & `leg-left`. +### Code examples + +Declare a class `my-first-class` and style it with a `color` to `"blue"` and a `background-color` to `"pink"`: + +```css +.my-first-class { + color: blue; + background-color: pink; +} +``` + +Apply classes to HTML elements: + +```html +
+
+
+``` + ### Expected output This is what you should see in the browser: