From 9314a1070bcb47e6a08b024f27803ad57654e4d8 Mon Sep 17 00:00:00 2001 From: Marie Malarme Date: Thu, 25 Feb 2021 18:03:59 +0000 Subject: [PATCH] Subject exercise 2 "The calling" (HTML id attribute) --- subjects/the-calling/README.md | 13 +++++++++++++ 1 file changed, 13 insertions(+) create mode 100644 subjects/the-calling/README.md diff --git a/subjects/the-calling/README.md b/subjects/the-calling/README.md new file mode 100644 index 000000000..8a42283e9 --- /dev/null +++ b/subjects/the-calling/README.md @@ -0,0 +1,13 @@ +### The calling + +Congrats! You created the very first base for your being and you witnessed its appearance on the digital world - your browser. But so far, it's a very rough sketch of the marvelous thing it could become ; you have to make it look more living-like. +First of all, instead of writing down what things are - you're not writing down on your hand the word 'hand', are you?) - we're going to identify them semantically with the very practical [`id`](https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/id) attribute. This `id` has to be a unique identifier in your webpage, which will allow you to target your element if needed. +Your can compare it to your name & surname ; this is what is identifying you to other people, and if someone's calling you by your name, you answer. + +So let's identify the 3 elements we have so far: in each section, remove the text content from inside the tag and set it as the value of the `id` attribute of the corresponding `section` tag. + +Open the page in the browser: you don't see anything? Don't freak out! Inspect the HTML that have been created with your [browser inspector tool](https://developer.mozilla.org/en-US/docs/Learn/Common_questions/What_are_browser_developer_tools), & if you worked well, you should see inside the `body` the 3 sections with the `id` attribute set in your HTML structure. + +### Notions + +- [`id` attribute](https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/id)