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

develop #5608

Closed
wants to merge 1 commit into from
Closed

develop #5608

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
18 changes: 9 additions & 9 deletions readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,15 +27,15 @@ 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://andrii-petruk.github.io/layout_moyo-header/)
- [TEST REPORT LINK](https://andrii-petruk.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.

- [ ] Header height is set in 1 place (for the links)
- [ ] Content is vertically centered (for any header height)
- [ ] CSS is used to show all letters in Uppercase (don't type them in HTML)
- [ ] Logo is an image wrapped with a link
- [ ] **CSS Variable** is used for a blue color
- [ ] Pseudo-element is used for a blue line below the active link
- [ ] Code follows all the [Code Style Rules ❗️](./checklist.md)
- [x] Header height is set in 1 place (for the links)
- [x] Content is vertically centered (for any header height)
- [x] CSS is used to show all letters in Uppercase (don't type them in HTML)
- [x] Logo is an image wrapped with a link
- [x] **CSS Variable** is used for a blue color
- [x] Pseudo-element is used for a blue line below the active link
- [x] Code follows all the [Code Style Rules ❗️](./checklist.md)
102 changes: 101 additions & 1 deletion src/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,112 @@
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:ital,wght@0,500;1,500&display=swap"
rel="stylesheet"
/>
<link
rel="stylesheet"
href="./style.css"
/>
</head>
<body>
<h1>Moyo header</h1>
<header class="header">
<a
href="#logo"
class="logo_link"
>
<img
src="images/logo.png"
alt="logo"
class="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"

Choose a reason for hiding this comment

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

The href attribute value /laptops&computers might cause issues because the & character is not encoded. Consider using /laptops%26computers to ensure proper URL encoding.

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>
78 changes: 78 additions & 0 deletions src/style.css
Original file line number Diff line number Diff line change
@@ -1,3 +1,81 @@
:root {
--header-bg: #fff;
--header-height: 60px;
--nav-link-color: #000;
--nav-link-hover-color: #00acdc;
--nav-font-size: 12px;
}

* {
box-sizing: border-box;
}

body {
margin: 0;
}

.header {
display: flex;
justify-content: space-between;
align-items: center;
background: var(--header-bg);
width: 100%;
padding: 0 50px;
}

.logo_link {
display: flex;
justify-content: center;
align-items: center;
}

.nav {
display: flex;
justify-content: space-between;
align-items: center;
}

.nav_list {
display: flex;
justify-content: space-between;
align-items: center;
list-style: none;
flex-direction: row;
margin: 0;
padding: 0;
gap: 20px;
}

.nav_link {
display: flex;
position: relative;
justify-content: center;
align-items: center;
text-decoration: none;
text-transform: uppercase;
color: var(--nav-link-color);
font-family: Roboto, sans-serif;
font-size: var(--nav-font-size);
font-weight: 500;
height: var(--header-height);
line-height: 14.6px;
}

.nav_link:hover {
color: var(--nav-link-hover-color);
}

.is-active {
color: var(--nav-link-hover-color);
}

.is-active::after {
content: '';
display: block;
width: 100%;
height: 4px;
background: var(--nav-link-hover-color);
position: absolute;

Choose a reason for hiding this comment

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

The position: absolute; property for the .is-active::after pseudo-element requires that the parent element has a position property set to relative, absolute, or fixed to ensure proper positioning. Ensure that the parent element of .is-active has a suitable position property.

border-radius: 8px;
bottom: 0;
}
Loading