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

New solution #5387

Open
wants to merge 4 commits 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://Oleksiy0909.github.io/layout_moyo-header/)
- [TEST REPORT LINK](https://Oleksiy0909.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=Roboto:wght@400;500&display=swap"
rel="stylesheet"
/>
<link
rel="stylesheet"
href="./style.css"
/>
</head>
<body>
<h1>Moyo header</h1>
<header class="header">
<a

Choose a reason for hiding this comment

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

Don't use spaces in <a> tag's href property. Anchor links should start with the # symbol and should not have spaces.

href="#"
class="header__link"
>
<img
class="header__logo"
src="./images/logo.png"

Choose a reason for hiding this comment

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

The alt attribute should describe the image content. Instead of 'logo', a more descriptive text could be used.

alt="logo"
/>
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.

Keep your attributes correctly formatted. If the HTML element has long attribute values or more than 2 attributes, start each one, including the first, on a new line with 2-space indentation related to the tag.

</a>
Comment on lines +32 to +42

Choose a reason for hiding this comment

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

Remember about correct indentation between parent and child elements. The <a> tag should be indented by 2 spaces inside the <header> tag, and its child <img> tag should be indented by 2 spaces inside the <a> tag.


<nav class="nav">
<ul class="nav__list">
<li class="nav__item">
<a
href="#"
class="nav__link is-active"
>
Apple
</a>
</li>

<li class="nav__item">
<a
href="#"
class="nav__link"
>
Samsung
</a>
</li>
<li class="nav__item">
Comment on lines +62 to +63

Choose a reason for hiding this comment

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

Add the blank line between the all links

Suggested change
</li>
<li class="nav__item">
</li>
<li class="nav__item">

<a
href="#"
class="nav__link"
>
Smartphones
</a>
</li>

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

<li class="nav__item">
<a
href="#"
class="nav__link"
>
Gadgets
</a>
</li>

<li class="nav__item">
<a
href="#"
class="nav__link"
>
Tablets
</a>
</li>

<li class="nav__item">
<a
href="#"
class="nav__link"
>
Photo
</a>
</li>

<li class="nav__item">
<a
href="#"
class="nav__link"
>
Video
</a>
</li>
</ul>
</nav>
Comment on lines +44 to +118

Choose a reason for hiding this comment

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

Add empty lines between multiline sibling blocks of HTML to add some 'air' and simplify reading. But don't add them between parent and child elements.

</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 @@
body {
margin: 0;
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.

It's good practice to specify a fallback font-family, in case the primary font cannot be loaded. Consider adding a generic font family as a fallback.

Choose a reason for hiding this comment

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

Move font styles to the html selector

font-weight: 500;
}

a {
text-decoration: none;
color: black;
}

.header {
display: flex;
justify-content: space-between;
align-items: center;
padding: 0 50px;
box-shadow: 0 2px 4 px rgba(0 0 0 0.05);

Choose a reason for hiding this comment

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

There is a syntax error in the box-shadow property value. The color function rgba should have commas separating the values.

}

.header__link {
display: block;
height: 40px;
width: 40px;
}

.header__logo {
height: 100%;
width: 100%;
}

.nav {
display: block;

Choose a reason for hiding this comment

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

The .nav class has a display: block; property, which is the default display value for the nav element. This line can be removed as it is redundant.

}

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

.nav__item {
margin-left: 20px;
}

.nav__item:first-child {
margin-left: 0;
}

.is-active {
color: #00acdc;

Choose a reason for hiding this comment

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

Create a variable for repeated color and use it everywhere

}

.is-active::after {
content: '';
position: absolute;
bottom: 0;
left: 0;
right: 0;
height: 4px;
border-radius: 2px;
background-color: #00acdc;
}

.nav__link {
position: relative;
display: flex;
align-items: center;
height: 60px;
font-family: Roboto, sans-serif;
font-size: 12px;
font-weight: 500;
white-space: nowrap;
text-transform: uppercase;
}

.nav__link:hover {
color: #00acdc;
}
Loading