diff --git a/.learn/resets/03-Inline-Styles/index.html b/.learn/resets/03-Inline-Styles/index.html deleted file mode 100644 index ab36cc54..00000000 --- a/.learn/resets/03-Inline-Styles/index.html +++ /dev/null @@ -1,17 +0,0 @@ - - - - 03 Inline Styles - - - - - - - - - - -
Hello
My brother
- - diff --git a/.learn/resets/03-List-styling/index.html b/.learn/resets/03-List-styling/index.html new file mode 100644 index 00000000..4a3a2dab --- /dev/null +++ b/.learn/resets/03-List-styling/index.html @@ -0,0 +1,37 @@ + + + + 03 List styling + + + +

Your favorite drinks

+

Coca Cola drinks

+ + +

Pepsi drinks

+ + +

Healthy drinks

+ + +

Web-developer drinks

+ + + diff --git a/exercises/01-Hello-World/README.md b/exercises/01-Hello-World/README.md index 798d0a19..da65dfa5 100644 --- a/exercises/01-Hello-World/README.md +++ b/exercises/01-Hello-World/README.md @@ -3,35 +3,36 @@ tutorial: "https://www.youtube.com/watch?v=rbtHLA813pU" --- # `01` Hello World in CSS -CSS is about styles. To apply styles you always have to follow this steps: +CSS is about adding styles to our HTML elements. -1. Read the HTML and pick what element do you want to decorate or apply styles to. -2. Programatically select the element you want to style using CSS Selectors. -3. Write the styling that you want by using CSS rules. - -That is it! The rest is just semantics! 😁 - -Look at this example: +The most **basic** way to apply a style to an HTML element is to use the html `style` attribute within the tag. This is called "inline styles" and works like this: ```HTML - -Click me to open google.com +Go to google ``` -We have an HTML anchor `` that takes people to google.com when clicked. -We use CSS to tell (selected) all the anchor tags and make then pink. +This will set the text color of the link above to red, and the font size to 14 pixels. + +In contemporary web design this way of applying styles is **discouraged**, because it is not efficient - you have to apply styles tag by tag. But you will run into examples of it and need to be familiar with it. + +To apply styles you always have to follow thΠ΅se steps: + +1. Read the HTML and pick what element you want to decorate to apply CSS to it. +2. Apply the style with the `style` attribute as above. + +That is it! The rest is just semantics! 😁 + ## πŸ“ Instructions -Paste this code on your website to see the results. +1. Within the `index.html` file, create the basic structure of an html page with the appropriate ``, `` and `` tags. +2. Inside of the body of the page, create an `

` tag that reads "HELLO WORLD!!!". +1. Set an inline style to change the text color of the tag to `color: orangered` and give it a solid red border of 1px. + -## πŸ’» Preview +### πŸ’‘ Hint: -It should look like this: +- A convenient way to import the basic html structure of your web page is to just type an exclamation mark `!` and select the emmet option that will pop up in Gitpod. +- Read how to apply borders here: https://www.w3schools.com/css/css_border_shorthand.asp +- For this exercise, do NOT use `styles.css` file or ``; diff --git a/exercises/03-Inline-Styles/README.md b/exercises/03-Inline-Styles/README.md deleted file mode 100644 index 87fb2848..00000000 --- a/exercises/03-Inline-Styles/README.md +++ /dev/null @@ -1,31 +0,0 @@ ---- -tutorial: "https://www.youtube.com/watch?v=jIMPLzpryuI" ---- - -# `03` Inline Styles - -Inline styles are a very bad idea unless you have no other choice (and that's a very uncommon situation). Sadly, we have to teach you how to do it because you may need to use them at some point. - -To use inline styles, instead of declaring a tag in the header of the document, you have to set the "style" attribute of any element with the CSS code you need to apply to that specific element. - -For example: - -```html -Go to google -``` - -Will set the color of that specific link to red and the font-size to 14px - -**Note:** - -You can append as many CSS rules as you want, within the same line, separated by semi-colon. - -## πŸ“ Instructions: - - -1. Set an inline style to change the background color of the table to green. For this exercise, do NOT use styles.css :( - - -### πŸ’‘ Hint: - -- How to use the background-size: http://lmgtfy.com/?q=css+inline+style diff --git a/exercises/03-Inline-Styles/index.html b/exercises/03-Inline-Styles/index.html deleted file mode 100644 index ab36cc54..00000000 --- a/exercises/03-Inline-Styles/index.html +++ /dev/null @@ -1,17 +0,0 @@ - - - - 03 Inline Styles - - - - - - - - - - -
Hello
My brother
- - diff --git a/exercises/03-Inline-Styles/tests.js b/exercises/03-Inline-Styles/tests.js deleted file mode 100644 index 8192affe..00000000 --- a/exercises/03-Inline-Styles/tests.js +++ /dev/null @@ -1,30 +0,0 @@ -const fs=require("fs"); -const path=require("path"); -const html=fs.readFileSync(path.resolve(__dirname, "./index.html"), "utf8"); - -jest.dontMock("fs"); - -describe("The Table tag should contain inline style background: green", function() { - beforeEach(() => { - //here I import the HTML into the document - document.documentElement.innerHTML = html.toString(); - }); - afterEach(() => { - jest.resetModules(); - }); - it("You should not change the existing head tag elements", function () { - let head = document.querySelector('head'); - let meta = head.querySelector("meta") - let title = head.querySelector('title').innerHTML - - expect(meta).toBe(null) - expect(title).toBe('03 Inline Styles') - }) - - it("The background should be green", function() { - const table = document.querySelector("table"); - // expect(table.style.background === "green").toBeTruthy(); - var styles = window.getComputedStyle(table); - expect(styles["background"]).toBe("green"); - }); -}); diff --git a/exercises/03-Inline-Styles/README.es.md b/exercises/03-List-styling/README.es.md similarity index 100% rename from exercises/03-Inline-Styles/README.es.md rename to exercises/03-List-styling/README.es.md diff --git a/exercises/03-List-styling/README.md b/exercises/03-List-styling/README.md new file mode 100644 index 00000000..74744621 --- /dev/null +++ b/exercises/03-List-styling/README.md @@ -0,0 +1,40 @@ +--- +tutorial: "https://www.youtube.com/watch?v=jIMPLzpryuI" +--- + +# `03` List styling + +In the front end we often have to list items and the way to do that is with `