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 task solution #3407

Open
wants to merge 8 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 6 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
@@ -1,7 +1,7 @@
# Moyo header
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://arturgorniak.github.io/layout_moyo-header/)
- [TEST REPORT LINK](https://arturgorniak.github.io/layout_moyo-header/report/html_report/)

> Follow [these instructions](https://mate-academy.github.io/layout_task-guideline/#how-to-solve-the-layout-tasks-on-github)

Expand Down
41 changes: 40 additions & 1 deletion src/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,45 @@
<link rel="stylesheet" href="./style.css">
</head>
<body>
<h1>Moyo header</h1>
<header class="header">
<a href="#home" class="logo__link">
<img
src="./images/logo.png"
alt="Moyo Header Logo"
>
</a>

Choose a reason for hiding this comment

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

Here should be an empty space, this a tag is a sibling to nav, generally the rule is (apart from the exception with repeated tags) that the siblings should have an empty space between them:

<div>
  <span></span>

  <p></p>

  <div>
    <ul>
      <li></li>
      <li></li>
    </ul>
  </div>
</div>

<nav class="nav">

Choose a reason for hiding this comment

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

When you have repeated tags there is no need for empty lines between them, for example:

<ul>
  <li></li>
  <li></li>
  <li></li>
  <li></li>
</ul>

<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"
class="nav__link"
data-qa="hover">Laptops & Computers
</a>

Choose a reason for hiding this comment

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

Should be:

Suggested change
<a
href="#laptops"
class="nav__link"
data-qa="hover">Laptops & Computers
</a>
<a
href="#laptops"
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>
73 changes: 73 additions & 0 deletions src/style.css
Original file line number Diff line number Diff line change
@@ -1,3 +1,76 @@
@import url("https://fonts.googleapis.com/css2?family=Roboto:wght@500&display=swap");

:root {
--light-blue: #00acdc;
--black: #000;
}

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

body {
margin: 0;
}

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

.nav {
display: flex;
}

.logo__link {
display: flex;
}

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

.nav__item {
margin-right: 20px;
}

.nav__item:last-child {
margin-right: 0;
}

.nav__link {
position: relative;
display: flex;
align-items: center;
font-size: 12px;
line-height: 15px;
padding: 22px 0;
text-transform: uppercase;
color: var(--black);
text-decoration: none;
}

.nav__link:hover {
color: var(--light-blue);
}

.nav__link.is-active {
color: var(--light-blue);
}

.nav__link.is-active::after {
position: absolute;
bottom: 0;
content: "";
display: block;
width: 100%;
height: 4px;
border-radius: 8px;
background-color: var(--light-blue);
}