-
Notifications
You must be signed in to change notification settings - Fork 4.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
add task solution #5378
base: master
Are you sure you want to change the base?
add task solution #5378
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -11,12 +11,106 @@ | |
content="ie=edge" | ||
/> | ||
<title>Moyo header</title> | ||
<link | ||
rel="preconnect" | ||
href="https://fonts.googleapis.com" | ||
/> | ||
<link | ||
rel="preconnect" | ||
href="https://fonts.gstatic.com" | ||
/> | ||
<link | ||
href="https://fonts.googleapis.com/css2?family=Roboto:wght@400;500;700&display=swap" | ||
rel="stylesheet" | ||
/> | ||
<link | ||
rel="stylesheet" | ||
href="./style.css" | ||
/> | ||
</head> | ||
<body> | ||
<h1>Moyo header</h1> | ||
<header class="header"> | ||
<a | ||
class="logo" | ||
href="#" | ||
> | ||
<img | ||
src="/src/images/logo.png" | ||
alt="logo" | ||
/> | ||
</a> | ||
Comment on lines
+32
to
+41
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Remember about correct indentation between parent and child elements. The |
||
|
||
<nav class="nav"> | ||
<ul class="nav__list"> | ||
<li class="nav__item"> | ||
<a | ||
href="#" | ||
class="nav__link is-active" | ||
> | ||
Apple | ||
Comment on lines
+46
to
+50
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Don't use spaces in |
||
</a> | ||
</li> | ||
<li class="nav__item"> | ||
<a | ||
href="#" | ||
class="nav__link" | ||
> | ||
Samsung | ||
</a> | ||
</li> | ||
<li class="nav__item"> | ||
<a | ||
href="#" | ||
class="nav__link" | ||
> | ||
Smartphones | ||
</a> | ||
</li> | ||
<li | ||
class="nav__item" | ||
data-qa="hover" | ||
> | ||
<a | ||
href="#" | ||
class="nav__link" | ||
> | ||
Laptops & Computers | ||
</a> | ||
</li> | ||
<li class="nav__item"> | ||
<a | ||
href="#" | ||
class="nav__link" | ||
> | ||
Gadgets | ||
</a> | ||
</li> | ||
<li class="nav__item"> | ||
<a | ||
href="#" | ||
class="nav__link" | ||
> | ||
Tablets | ||
</a> | ||
</li> | ||
<li class="nav__item"> | ||
<a | ||
href="#" | ||
class="nav__link" | ||
> | ||
Photo | ||
</a> | ||
</li> | ||
<li class="nav__item"> | ||
<a | ||
href="#" | ||
class="nav__link" | ||
> | ||
Video | ||
</a> | ||
</li> | ||
</ul> | ||
Comment on lines
+44
to
+112
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Add empty lines between multiline sibling blocks of HTML. There should be an empty line between each |
||
</nav> | ||
</header> | ||
</body> | ||
</html> |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,78 @@ | ||
* { | ||
margin: 0; | ||
padding: 0; | ||
box-sizing: border-box; | ||
list-style: none; | ||
Comment on lines
+1
to
+5
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Don't use |
||
} | ||
|
||
body { | ||
margin: 0; | ||
padding: 0; | ||
} | ||
|
||
.header { | ||
max-width: 1200px; | ||
display: flex; | ||
justify-content: space-between; | ||
align-items: center; | ||
font-family: Roboto, system-ui; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Remember to use fallback fonts - alternative font-family in case the main one doesn't work. For example, 'Roboto', Arial, sans-serif. |
||
font-size: 12px; | ||
font-weight: 500; | ||
position: relative; | ||
padding: 0 50px; | ||
margin: 0 auto; | ||
|
||
--nav-link-color: #00acdc; | ||
} | ||
|
||
.logo { | ||
display: block; | ||
height: 40px; | ||
width: 40px; | ||
} | ||
|
||
.nav__list { | ||
display: flex; | ||
align-items: center; | ||
justify-content: space-between; | ||
text-align: center; | ||
padding: 0; | ||
} | ||
|
||
.nav__item { | ||
list-style: none; | ||
Comment on lines
+42
to
+43
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Don't use tag names for styling (except |
||
line-height: 60px; | ||
} | ||
|
||
.nav__link { | ||
display: block; | ||
height: 60px; | ||
text-decoration: none; | ||
color: #000; | ||
text-transform: uppercase; | ||
position: relative; | ||
} | ||
|
||
.is-active { | ||
color: var(--nav-link-color); | ||
} | ||
|
||
.is-active::after { | ||
position: absolute; | ||
left: 0; | ||
bottom: 0; | ||
content: ''; | ||
display: block; | ||
width: 100%; | ||
height: 4px; | ||
background-color: var(--nav-link-color); | ||
border-radius: 2px; | ||
} | ||
|
||
.nav__item:not(:last-child) { | ||
margin-right: 20px; | ||
} | ||
|
||
.nav__link:hover { | ||
color: var(--nav-link-color); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The
alt
attribute should describe the image content, not just say 'logo'. It should ideally describe what the logo is about or what company it represents.