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 Moyo header solution #4905

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://FaiHamid.github.io/layout_moyo-header/)
- [TEST REPORT LINK](https://FaiHamid.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
94 changes: 93 additions & 1 deletion src/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,104 @@
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@500&display=swap"
rel="stylesheet"
/>
<link
rel="stylesheet"
href="./style.css"
/>
</head>
<body>
<h1>Moyo header</h1>
<header class="header">
<a
href="https://www.moyo.ua/ua/"
class="logo"
>
<img
src="images/logo.png"
alt="logo_header"
/>
</a>

Choose a reason for hiding this comment

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

Suggested change

<nav class="nav_header">
<ul class="header_nav_list">
<li class="header_nav_item">
<a
href="https://www.moyo.ua/ua/portal_brand/apple_1/"
class="nav_link is-active"
>
Apple
</a>
</li>
<li class="header_nav_item">
<a
href="https://www.moyo.ua/ua/telecommunication/smart/samsung/"
class="nav_link"
>
Samsung
</a>
</li>
<li class="header_nav_item">
<a
href="https://www.moyo.ua/ua/telecommunication/smart/"
class="nav_link"
>
Smartphones
</a>
</li>
<li class="header_nav_item">
<a
href="https://www.moyo.ua/ua/comp-and-periphery/"
class="nav_link"
data-qa="hover"
>
Laptops & Computers
</a>
</li>
<li class="header_nav_item">
<a
href="https://www.moyo.ua/ua/gadgets/"
class="nav_link"
>
Gadgets
</a>
</li>
<li class="header_nav_item">
<a
href="https://www.moyo.ua/ua/tablet_el_knigi/tablet/"
class="nav_link"
>
Tablets
</a>
</li>
<li class="header_nav_item">
<a
href="https://www.moyo.ua/ua/news.html"
class="nav_link"
>
Photo
</a>
</li>
<li class="header_nav_item">
<a
href="https://www.moyo.ua/ua/news/kak_vkusno_svarit_psheno_3_varianta_prigotovleniya.html"
class="nav_link"
>
Video
</a>
</li>
</ul>
</nav>
</header>
</body>
</html>
76 changes: 76 additions & 0 deletions src/style.css
Original file line number Diff line number Diff line change
@@ -1,3 +1,79 @@
* {
box-sizing: border-box;
}

body {
font-family: Roboto, Arial, sans-serif;
font-size: 12px;
font-weight: 500;
margin: 0;

--hover-color: #00acdc;
}

.header {
background-color: #fff;

display: flex;
justify-content: space-between;
align-items: center;
margin: auto;
}

.logo {
display: inline-flex;
margin-left: 50px;
}

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

.nav_header {
margin-right: 50px;
}

.header_nav_list {
list-style: none;
margin: 0;
padding: 0;
display: flex;
align-items: center;
}

.nav_link {
height: 100%;
line-height: 60px;
display: block;
text-transform: uppercase;
color: #000;
text-decoration: none;
}

.header_nav_item:nth-child(n + 2) {
margin-left: 20px;
}

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

.nav_link:active {
content: '';
}

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

.is-active::after {
content: '';
position: absolute;
top: 56px;
display: block;
background-color: var(--hover-color);
border-radius: 8px;
height: 4px;
width: 37px;

Choose a reason for hiding this comment

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

To not add specific px width, you can set position: relative for .is-active element and addwidth: 100%for after element

Also better to add bottom: 0 instead of setting top

}
Loading