-
Notifications
You must be signed in to change notification settings - Fork 6k
add solution #7280
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
base: master
Are you sure you want to change the base?
add solution #7280
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 |
|---|---|---|
| @@ -1,6 +1,19 @@ | ||
| <!doctype html> | ||
| <html lang="en"> | ||
| <head> | ||
| <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@500&display=swap" | ||
| rel="stylesheet" | ||
| /> | ||
|
|
||
| <meta charset="UTF-8" /> | ||
| <meta | ||
| name="viewport" | ||
|
|
@@ -17,6 +30,87 @@ | |
| /> | ||
| </head> | ||
| <body> | ||
| <h1>Moyo header</h1> | ||
| <header> | ||
| <a | ||
| href="https://www.moyo.ua/ua/" | ||
| class="logo" | ||
| > | ||
| <img | ||
| class="logo_img" | ||
| src="images/logo.png" | ||
| alt="website logo" | ||
| /> | ||
| </a> | ||
|
|
||
| <nav class="nav"> | ||
| <ul class="nav__list"> | ||
| <li class="nav__item"> | ||
| <a | ||
| href="apple" | ||
| class="nav__link is-active" | ||
| > | ||
| apple | ||
| </a> | ||
| </li> | ||
| <li class="nav__item"> | ||
| <a | ||
| href="samsung" | ||
| class="nav__link" | ||
| > | ||
| samsung | ||
| </a> | ||
| </li> | ||
| <li class="nav__item"> | ||
| <a | ||
| href="smartphones" | ||
| class="nav__link" | ||
| > | ||
| smartphones | ||
| </a> | ||
| </li> | ||
| <li class="nav__item"> | ||
| <a | ||
| href="laptops & computers" | ||
|
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. The |
||
| class="nav__link" | ||
| data-qa="hover" | ||
| > | ||
| laptops & computers | ||
| </a> | ||
| </li> | ||
| <li class="nav__item"> | ||
| <a | ||
| href="gadgets" | ||
| class="nav__link" | ||
| > | ||
| gadgets | ||
| </a> | ||
| </li> | ||
| <li class="nav__item"> | ||
| <a | ||
| href="tablets" | ||
| class="nav__link" | ||
| > | ||
| tablets | ||
| </a> | ||
| </li> | ||
| <li class="nav__item"> | ||
| <a | ||
| href="photo" | ||
| class="nav__link" | ||
| > | ||
| photo | ||
| </a> | ||
| </li> | ||
| <li class="nav__item"> | ||
| <a | ||
| href="video" | ||
| class="nav__link" | ||
| > | ||
| video | ||
| </a> | ||
| </li> | ||
| </ul> | ||
| </nav> | ||
| </header> | ||
| </body> | ||
| </html> | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,3 +1,71 @@ | ||
| :root { | ||
| --main-color: #00acdc; | ||
| } | ||
|
|
||
| body { | ||
| margin: 0; | ||
| padding: 0; | ||
| } | ||
|
|
||
| header { | ||
|
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. According to the task requirements, you should avoid styling elements by their tag name (except for |
||
| font-family: Roboto, sans-serif; | ||
| font-size: 12px; | ||
|
|
||
| display: flex; | ||
| justify-content: space-between; | ||
| align-items: center; | ||
| padding: 0 50px; | ||
| } | ||
|
|
||
| .logo_img { | ||
| display: block; | ||
| height: 40px; | ||
| width: 40px; | ||
| margin: 10px 0; | ||
|
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. This margin contributes to the header's height, but the requirement is that the height should be set in one place, on the navigation links. Also, using both top and bottom margins ( |
||
| } | ||
|
|
||
| .nav__list { | ||
| display: flex; | ||
| padding: 0; | ||
| margin: 0; | ||
| } | ||
|
|
||
| .nav__item { | ||
| list-style: none; | ||
| text-decoration: none; | ||
| justify-content: center; | ||
|
Comment on lines
+35
to
+36
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. These CSS properties have no effect here. |
||
| margin-left: 20px; | ||
| } | ||
|
|
||
| .nav__item:first-child { | ||
| margin-left: 0; | ||
| } | ||
|
|
||
| .nav__link { | ||
| display: inline-block; | ||
| text-decoration: none; | ||
| text-transform: uppercase; | ||
| color: #000; | ||
|
|
||
| padding: 22.5px 0; | ||
|
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. This violates the requirement that 'Nav Links should not have any padding'. Instead, you should set a specific |
||
| } | ||
|
|
||
| .nav__link:hover { | ||
| color: var(--main-color); | ||
| } | ||
|
|
||
| .is-active { | ||
| position: relative; | ||
| color: var(--main-color); | ||
| } | ||
|
|
||
| .nav__link.is-active::after { | ||
| content: ''; | ||
| position: absolute; | ||
| bottom: 0; | ||
| left: 0; | ||
| width: 100%; | ||
| height: 4px; | ||
| border-radius: 4px; | ||
| background-color: var(--main-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
altattribute should be more descriptive. While 'website logo' is acceptable, something more specific like 'Moyo website logo' would better align with best practices for accessibility.