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

Moyo-Header(add task solution) #4911

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 1 commit
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://gorbachovam00.github.io/layout_moyo-header/)
- [TEST REPORT LINK](https://gorbachovam00.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
113 changes: 111 additions & 2 deletions src/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,19 +4,128 @@
<meta charset="UTF-8" />
<meta
name="viewport"
content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0"
content="width=device-width, initial-scale=1.0"
/>
<meta
http-equiv="X-UA-Compatible"
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&display=swap"
rel="stylesheet"
/>
<link
rel="stylesheet"
href="./style.css"
/>
</head>
<body>
<h1>Moyo header</h1>
<header class="header">
<div class="container">
<div class="header__container">

Choose a reason for hiding this comment

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

These divs are redundant, so you need to remove it

Suggested change
<div class="container">
<div class="header__container">

<a href="index.html">
<img
src="./images/logo.png"
alt="logo"
/>
</a>
<nav class="header__nav">
<ul class="header__menu">
<li class="menu-item">

Choose a reason for hiding this comment

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

Fix class everywhere

Suggested change
<nav class="header__nav">
<ul class="header__menu">
<li class="menu-item">
<nav class="nav">
<ul class="nav__list">
<li class="nav__item">

<a
href="#"
class="link link-1 is-active"

Choose a reason for hiding this comment

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

Fix class everywhere

Suggested change
class="link link-1 is-active"
class="nav__link is-active"

>
Apple
</a>
</li>
<li class="menu-item">

Choose a reason for hiding this comment

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

Add a blank line between the links

Suggested change
</li>
<li class="menu-item">
</li>
<li class="menu-item">

<a
href="#"
class="link link-2"
>
Samsung
</a>
</li>
<li class="menu-item">
<a
href="#"
class="link link-3"
>
Smartphones
</a>
</li>
<li class="menu-item">
<a
href="#"
class="link link-4"
data-qa="hover"
>
Laptops & Computers
</a>
</li>
<li class="menu-item">
<a
href="#"
class="link link-5"
>
Gadgets
</a>
</li>
<li class="menu-item">
<a
href="#"
class="link link-6"
>
Tablets
</a>
</li>
<li class="menu-item">
<a
href="#"
class="link link-7"
>
Photo
</a>
</li>
<li class="menu-item">
<a
href="#"
class="link link-8"
>
Video
</a>
</li>
</ul>
</nav>
</div>
</div>
</header>
</body>
</html>

<!-- <!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta
name="viewport"
content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0"
/>
<meta
http-equiv="X-UA-Compatible"
content="ie=edge"
/>
<title>Document</title>
</head>
<body></body>
</html> -->

Choose a reason for hiding this comment

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

Remove comments

135 changes: 135 additions & 0 deletions src/style.css
Original file line number Diff line number Diff line change
@@ -1,3 +1,138 @@
*,
*::before,
*::after {
box-sizing: border-box;
}

:root {
--color-text: #000;
--color-header: #00acdc;
}

body {
margin: 0;
font-family: Roboto, sans-serif;
font-size: 12px;
font-weight: 500;
line-height: 1.2;
Comment on lines +13 to +16

Choose a reason for hiding this comment

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

Move these styles to the html selector

}

a {
display: inline-block;
}

img {
display: block;
}

.link {
text-decoration: none;
color: var(--color-text);
text-transform: uppercase;
}

.menu-item {
list-style: none;
height: 60px;
line-height: 60px;
}

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

.header__menu {
display: flex;
align-items: center;
padding: 0;
margin: 0;
}

ul li:not(:last-child) {

Choose a reason for hiding this comment

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

Suggested change
ul li:not(:last-child) {
.nav__item:not(:last-child) {

margin-right: 20px;
}

.link.link-1 {
color: var(--color-header);
}

.link.link-4:hover {
color: var(--color-header);
}

.is-active::after {
display: block;
position: absolute;
content: '';
width: 37px;

Choose a reason for hiding this comment

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

Suggested change
width: 37px;
width: 100%;

height: 4px;
background-color: var(--color-header);
border-radius: 8px;
top: 56px;

Choose a reason for hiding this comment

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

Suggested change
top: 56px;
bottom: 0;

}

/* .container {
margin: 0 auto;
} */

/* .header__container {
display: flex;
justify-content: space-between;
align-items: center;
padding: 10px 50px;
}

Choose a reason for hiding this comment

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

Remove comments everywhere


.header__nav {
height: 15px;
}

.header__menu {
display: flex;
margin: 0;
padding: 0;
}

ul li:not(:last-child) {
margin-right: 20px;
}

img {
display: block;
}

a {
display: inline-block;
}

.menu-item {
list-style: none;
}

.link {
text-decoration: none;
color: var(--color-text);
text-transform: uppercase;
line-height: 1.2;
}

.link.link-1 {
color: var(--color-header);
}

.link.link-4:hover {
color: var(--color-header);
}

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