You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: readme.md
+48-34Lines changed: 48 additions & 34 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -10,7 +10,7 @@ In this Module Exercise you will apply all the concepts you have been learning,
10
10
- Structuring your HTML page with **Block Elements**.
11
11
- Adding content to your HTML page with **Inline Elements**.
12
12
13
-
## Requirements
13
+
## Requirements
14
14
15
15
- Go to the [HTML module exercise repository](https://github.com/ironhack-labs/lab-html-cloning-medium) on Github.
16
16
- Click on the button "Clone or download" and a window will appear:
@@ -27,21 +27,28 @@ The `starter-code` folder contains an `index.html` file with the main structure
27
27
28
28
#### Introduction
29
29
30
-
In this exercise, you will clone a [Medium](https://medium.com/) article. Medium is a site that contains interesting articles about a variety of topics, we highly recommend you to follow some of the authors if you have interest in [Digital Design](https://medium.com/topic/digital-design), [JavaScript](https://medium.com/tag/javascript), [Bitcoins](https://medium.com/tag/bitcoin), or [Artificial Intelligence](https://medium.com/tag/artificial-intelligence).
30
+
In this exercise, you will clone the landing page from the [NPM website](https://www.npmjs.com/). NPM is a package manager for NodeJs that we will use a lot later in the course.
31
31
32
-
In this exercise, you will clone the [8 Things Every Person Should Do Before 8 a.m.](https://medium.com/the-mission/8-things-every-person-should-do-before-8-a-m-cc0233e15c8d) article. This is a two-part article, where we are going to clone first of all the HTML Structure. Later in the second part, we are going to style this HTML structure.
32
+
You can see the real page [here](https://www.npmjs.com/).
As you can see, the article is very long. We want you to get focus on the HTML structure, not on the content. In each article section, **it's enough to copy-paste three paragraphs of content**, not the all of content. For example, in the following section you have to add just the paragraphs in the red box:
38
+
Looking at this picture of the page, we can see that there are quite a few styles being applied to this web page. We have background colors for different parts of the page, different background colors, bold font, centered font, and elements being positioned very deliberately with CSS.
During this exercise, we will be creating the HTML for this page, without any of the styles. Don't worry, we are going to come back later and make our page look complete. But for now, the page that we are going to create should look like this
39
41
40
-
As you can see, you just have to add the section's title and the first three paragraphs. You have also to remember that you just have to add the HTML structure. So, for the image above, the result we want is the following:
**As you can see, we don't have any kind of styles here, just HTML and text.** To make this easier to visualize, copy and paste the following into your [**Chrome Console**](https://developers.google.com/web/tools/chrome-devtools/console/) (Ctrl + shift + J on Windows / Linux, Cmd + Option + J on Mac), and hit enter:
45
+
46
+
#### Setup
47
+
48
+
If you visited the NPM website, you probably noticed that the page is a lot longer than the picture provided in this assignment. That's okay, we're not going to recreate the whole thing. For this assignment, we will be cloning only the top 4 sections, reflected in the picture provided above.
49
+
50
+
51
+
**It might be hard to get used to the idea of making a version of a web page with no styles, since it doesn't really look like a web site at all.** To make this easier to visualize go to the [NPM website](https://www.npmjs.com/) and copy and paste the following into your [**Chrome Console**](https://developers.google.com/web/tools/chrome-devtools/console/) (Ctrl + shift + J on Windows / Linux, Cmd + Option + J on Mac), and hit enter:
45
52
46
53
```javascript
47
54
// disable all externally linked stylesheets
@@ -56,7 +63,7 @@ for (var i = arAllElements.length - 1; i >= 0; i--) {
56
63
if (elmOne.nodeName.toUpperCase() =='STYLE') {
57
64
// remove <style> elements defined in the page <head>
58
65
elmOne.parentNode.removeChild(elmOne);
59
-
} else {
66
+
} else {
60
67
// remove per-element styles and style-related attributes
61
68
elmOne.setAttribute('style', '');
62
69
elmOne.setAttribute('size', '');
@@ -68,44 +75,51 @@ for (var i = arAllElements.length - 1; i >= 0; i--) {
68
75
}
69
76
```
70
77
71
-
This will make all of the styles disappear!
78
+
This will make all of the styles disappear! As you can see, the official website now looks a lot more like the picture of our HTML-only version of the site. This script will work on any web page.
79
+
80
+
**To be clear, the goal of this assignment is to clone the picture provided above of our HTML-only version of the page, not the actual page.**
72
81
73
82
#### Time to Code
74
83
75
-
The most difficult part of this exercise is try to figure out what you need to structure the article, and picking the correct *semantic* tags. This will make your job easier in the next exercise when it comes time to styling.
84
+
The most difficult part of this exercise is deciding how to structure the page and picking the correct *semantic* tags for the job. Picking the right semantic tags will make your job easier in the next exercise when it comes time to styling.
85
+
86
+
Our recommendation is to try to keep it simple. Try to identify the different sections, and add `id`'s or `classes` to each `<div>`, `<section>`, `<ul>`, or `<header>` block elements to identify these elements. i.e.:
Our recommendation is: try to avoid thinking in the composition, just in the text and images. Try to identify the different sections, and add `id`'s to each `<div>`, `<section>`, `<article>`, or `<header>` block elements to identify these elements. i.e.:
**But don't worry, that's okay. Remember, we will go back later and make our site look official, for now, let's build our ugly wine list!**
108
123
109
-
The result of this HTML code will be just plain text and images... but don't worry for that, you are going to style this page later on in another exercise :)
0 commit comments