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
+17-1Lines changed: 17 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -19,6 +19,22 @@ npm start
19
19
20
20
Complete the following tasks to complete this project.
21
21
22
-
### Convert the Header to semantic HTML.
22
+
### Convert the Header
23
23
24
24
The element with a class of "header" isn't using the most semantic HTML tag it could be using. Switch it to use an element that most accurately wraps the header content for a page.
25
+
26
+
### Semantic Navigation
27
+
28
+
Our `.nav` element in the header of the page isn't using the most semantic HTML tags it could be using. `ul` is the correct one for this list of navigation items, but we should wrap this element with a more semantic element to indicate it is a navigation. Go ahead and add this.
29
+
30
+
### Create Sections
31
+
32
+
Each of the main content areas of our portfolio could be switched from using `div` tags to something that more accurately describes them as sections of our page. Update the `.tagline`, `.skills` and `.contact` sections to use a more semantic HTML tag.
33
+
34
+
### Main Content
35
+
36
+
Our 3 main sections make up the focus of our page. Wrap these three sections (tagline, skills and contact) in an HTML element that gives it the correct focus.
37
+
38
+
### Footer
39
+
40
+
Lastly, the element with a class of `footer` isn't the most semantic use of that area either. Luckily HTML 5 has a much better element we can use for footers. Update this element to use the semantically correct tag.
assert.isOk(header,'We need a `.header` element.');
20
-
});
21
-
22
-
it('should have a non-empty title @h1',()=>{
23
-
consth1=doc.querySelector('.header h1');
24
-
assert.isOk(h1,'We need an `h1` element inside `.header`.');
25
-
assert.isOk(h1.textContent,'Our header\'s `h1` element cannot be empty.');
18
+
constheader=doc.querySelector('header');
19
+
assert.isOk(header,'We need a `header` element.');
26
20
});
27
21
28
-
it('should have a non-empty description @h2',()=>{
29
-
consth2=doc.querySelector('.header h2');
30
-
assert.isOk(h2,'We need an `h2` element inside `.header`.');
31
-
assert.isOk(h2.textContent,'Our header\'s `h2` element cannot be empty.');
22
+
it('should not exist @header',()=>{
23
+
constheader=doc.querySelector('.header');
24
+
assert.isOk(!header,'Make sure to remote the `.header` class -- we no longer need it.');
32
25
});
33
26
});
34
27
35
28
36
29
/**
37
-
* TAGLINE
30
+
* NAV
38
31
*/
39
-
describe('tagline',()=>{
40
-
it('should exist @tagline',()=>{
41
-
consttagline=doc.querySelector('.tagline');
42
-
assert.isOk(tagline,'We need a `.tagline` element.');
32
+
describe('nav',()=>{
33
+
it('should exist @nav',()=>{
34
+
constnav=doc.querySelector('header nav');
35
+
assert.isOk(nav,'We need a `nav` element inside `header`.');
43
36
});
44
37
45
-
it('should have a non-empty h3 tag @tagline-content',()=>{
46
-
consth3=doc.querySelector('.tagline h3');
47
-
assert.isOk(h3,'We need an `h3` element inside `.tagline`.');
48
-
assert.isOk(h3.textContent,'Our tagline\'s `h3` element cannot be empty.');
49
-
});
50
-
51
-
it('should have a descriptive paragraph @tagline-content',()=>{
52
-
constp=doc.querySelector('.tagline p');
53
-
assert.isOk(p,'We need a `p` element inside `.tagline`.');
54
-
assert.isOk(p.textContent,'Our tagline\'s `p` element cannot be empty.');
38
+
it('should remove the existing class @nav',()=>{
39
+
constnav=doc.querySelector('header .nav');
40
+
assert.isOk(!nav,'We no longer need an element with a class of `.nav`. Go ahead and remove it.');
55
41
});
56
42
});
57
43
58
44
59
45
/**
60
-
* SKILLS
46
+
* SECTION
61
47
*/
62
-
describe('skills',()=>{
63
-
it('should exist @skills',()=>{
64
-
constskills=doc.querySelector('.skills');
65
-
assert.isOk(skills,'We need a `.skills` element.');
66
-
});
67
-
68
-
it('should have a non-empty h3 tag @skills-content',()=>{
69
-
consth3=doc.querySelector('.skills h3');
70
-
assert.isOk(h3,'We need an `h3` element inside `.skills`.');
71
-
assert.isOk(h3.textContent,'Our skills\' `h3` element cannot be empty.');
48
+
describe('section',()=>{
49
+
it('should convert the tagline @section',()=>{
50
+
constel=doc.querySelector('.tagline');
51
+
assert.isOk(el.length>0,'Looks like you removed the element with a class of `.tagline`. You will still need that, but will need to change it\'s element.');
52
+
assert.equal(el.tagName.toLowerCase(),'section','Make sure to change the element with a class of `tagline` to a `section` element.');
72
53
});
73
54
74
-
it('should have a descriptive paragraph @skills-content',()=>{
75
-
constp=doc.querySelector('.skills p');
76
-
assert.isOk(p,'We need a `p` element inside `.skills`.');
77
-
assert.isOk(p.textContent,'Our skills\' `p` element cannot be empty.');
55
+
it('should convert the skills @section',()=>{
56
+
constel=doc.querySelector('.skills');
57
+
assert.isOk(el.length>0,'Looks like you removed the element with a class of `.skills`. You will still need that, but will need to change it\'s element.');
58
+
assert.equal(skillsWithHtml.tagName.toLowerCase(),'section','Make sure to change the element with a class of `skills` to a `section` element.');
78
59
});
79
60
80
-
it('should have an unordered list of your skills @skills-list',()=>{
81
-
constul=doc.querySelector('.skills ul');
82
-
assert.isOk(ul,'We need a `ul` element inside `.skills`.');
83
-
});
84
-
85
-
it('should have at least 3 skills @skills-list',()=>{
86
-
constskillItems=doc.querySelectorAll('.skills ul li');
87
-
assert.isAtLeast(skillItems.length,3,'We need at least 3 `li` elements inside the skills\' `ul`.');
88
-
});
89
-
90
-
it('should have one skill that contains HTML @skills-list',()=>{
91
-
constskillItems=Array.from(doc.querySelectorAll('.skills ul li'));
92
-
consthtmlRegex=/html/i;
93
-
94
-
constskillsWithHtml=skillItems
95
-
.map(li=>li.textContent)
96
-
.filter(skill=>htmlRegex.test(skill));
97
-
98
-
assert.equal(skillsWithHtml.length,1,'HTML needs be part of one of your skills.');
61
+
it('should convert the contact @section',()=>{
62
+
constel=doc.querySelector('.contact');
63
+
assert.isOk(el.length>0,'Looks like you removed the element with a class of `.contact`. You will still need that, but will need to change it\'s element.');
64
+
assert.equal(skillsWithHtml.tagName.toLowerCase(),'section','Make sure to change the element with a class of `contact` to a `section` element.');
99
65
});
100
66
});
101
67
102
68
103
69
/**
104
-
* CONTACT
70
+
* MAIN
105
71
*/
106
-
describe('contact',()=>{
107
-
it('should exist @contact',()=>{
108
-
constcontact=doc.querySelector('.contact');
109
-
assert.isOk(contact,'We need a `.contact` element.');
72
+
describe('main',()=>{
73
+
it('should exist @main',()=>{
74
+
constheader=doc.querySelector('main');
75
+
assert.isOk(header,'We need a `main` element.');
110
76
});
111
77
112
-
it('should have a non-empty h3 tag @contact-content',()=>{
113
-
consth3=doc.querySelector('.contact h3');
114
-
assert.isOk(h3,'We need an `h3` element inside `.contact`.');
115
-
assert.isOk(h3.textContent,'Our contact\'s `h3` element cannot be empty.');
78
+
it('should not exist @main',()=>{
79
+
constsections=doc.querySelector('main section');
80
+
assert.isOk(sections.length>=3,'Make sure to move all of the `section` elements into our new `main` element.');
116
81
});
82
+
});
117
83
118
-
it('should have a descriptive paragraph @contact-content',()=>{
119
-
constp=doc.querySelector('.contact p');
120
-
assert.isOk(p,'We need a `p` element inside `.contact`.');
121
-
assert.isOk(p.textContent,'Our contact\'s `p` element cannot be empty.');
84
+
/**
85
+
* FOOTER
86
+
*/
87
+
describe('footer',()=>{
88
+
it('should exist @footer',()=>{
89
+
constfooter=doc.querySelector('footer');
90
+
assert.isOk(footer,'We need a `footer` element.');
122
91
});
123
92
124
-
it('should have a link with an href within the paragraph @contact-link',()=>{
125
-
consta=doc.querySelector('.contact p a');
126
-
assert.isOk(a,'We need a `a` element our inside contact\'s `p` element.');
127
-
assert.isOk(a.textContent,'Our contact\'s `a` element cannot be empty.');
128
-
assert.isOk(a.getAttribute('href'),'Our contact\'s `a` element needs a non-empty `href` attribute.');
93
+
it('should not exist @main',()=>{
94
+
constfooter=doc.querySelector('.footer');
95
+
assert.isOk(!footer,'Remove the `footer` class. Since we\'re using semantic HTML, we no longer need that one.');
0 commit comments