Skip to content
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 #5878

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@ The page should match the design Pixel Perfect: all the sizes, colors and distan

❗️ Replace `<your_account>` with your Github username and copy the links to `Pull Request` description:

- [DEMO LINK](https://<your_account>.github.io/layout_moyo-header/)
- [TEST REPORT LINK](https://<your_account>.github.io/layout_moyo-header/report/html_report/)
- [DEMO LINK](https://annalahmaniuk.github.io/layout_moyo-header/)
- [TEST REPORT LINK](https://annalahmaniuk.github.io/layout_moyo-header/report/html_report/)

❗️ Copy this `Checklist` to the `Pull Request` description after links, and put `- [x]` before each point after you checked it.

Expand Down
101 changes: 100 additions & 1 deletion src/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,111 @@
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=Inter:ital,opsz,wght@0,14..32,100..900;1,14..32,100..900&family=Roboto:wght@500&display=swap"
rel="stylesheet"
/>
<link
rel="stylesheet"
href="./style.css"
/>
</head>
<body>
<h1>Moyo header</h1>
<header class="header">
<a
href="#"
class="header_link"
>
<img
src="images/logo.png"
alt="logo Moyo"
/>
</a>
Comment on lines +33 to +41

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Consider adding aria-label to the anchor tag for better accessibility, especially if the link text is not descriptive enough for screen readers.


<nav class="nav">
<ul class="nav_list">
<li class="nav_item">
<a
class="nav_link is-active"
href="#"
>
Apple
</a>
Comment on lines +46 to +51

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The is-active class is used here. Ensure that this class is styled in your CSS to visually indicate the active state of the navigation item.

</li>

<li class="nav_item">
<a
class="nav_link"
href="#"
>
Samsung
</a>
</li>

<li class="nav_item">
<a
class="nav_link"
href="#"
>
Smartphones
</a>
</li>

<li class="nav_item">
<a
class="nav_link"
href="#"
data-qa="hover"
>
Laptops & Computers
</a>
</li>

<li class="nav_item">
<a
class="nav_link"
href="#"
>
Gadgets
</a>
</li>

<li class="nav_item">
<a
class="nav_link"
href="#"
>
Tablets
</a>
</li>

<li class="nav_item">
<a
class="nav_link"
href="#"
>
Photo
</a>
</li>

<li class="nav_item">
<a
class="nav_link"
href="#"
>
Video
</a>
</li>
</ul>
</nav>
Comment on lines +43 to +118

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Consider using semantic HTML5 elements like <nav> for the navigation section to enhance the semantic structure of the document.

</header>
</body>
</html>
64 changes: 64 additions & 0 deletions src/style.css
Original file line number Diff line number Diff line change
@@ -1,3 +1,67 @@
:root {
--accent-color: #00acdc;
}

html {
font-family: Roboto, sans-serif;

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ensure that the font 'Roboto' is properly loaded in your HTML file, as it is being used as the primary font-family here.

}

body {
margin: 0;
}

.header {
display: flex;
justify-content: space-between;
padding: 0 50px;
margin: 0;
align-items: center;
}

.header_link {
width: 40px;
height: 40px;
}

.nav_list {
margin: 0;
padding: 0;
display: flex;
list-style: none;
}

.nav_link {
margin-right: 20px;
position: relative;
font-weight: 500;
font-size: 12px;
display: block;
text-transform: uppercase;
line-height: 60px;
text-decoration: none;
color: #000;
}

.nav_item:last-child .nav_link {
margin-right: 0;
}

/* stylelint-disable-next-line no-descending-specificity */
.nav_link:hover {
color: #00acdc;
}
Comment on lines +50 to +52

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The comment about disabling stylelint for no-descending-specificity suggests there might be a specificity issue. Consider reviewing your CSS selectors to ensure specificity is managed properly without needing to disable linting rules.


.is-active {
color: var(--accent-color);
}

.is-active::after {
content: '';
display: block;
position: absolute;
bottom: 0;
width: 100%;
height: 4px;
background-color: var(--accent-color);
border-radius: 8px;
}
Comment on lines +54 to +67

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The .is-active class is styled to indicate the active state of a navigation link. Ensure that this class is applied correctly in your HTML to reflect the active state visually.

Loading