Skip to content
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
96 changes: 95 additions & 1 deletion src/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,106 @@
content="ie=edge"
/>
<title>Moyo header</title>
<link
rel="preconnect"
href="https://fonts.googleapis.com"
/>
<link
rel="preconnect"
href="https://fonts.gstatic.com"
crossorigin="anonymous"
/>
<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="index.html"
class="logo"
>
<img
src="images/logo.png"
alt="Moyo website logo"
class="logo__img"
/>
</a>

<nav class="nav">
<ul class="nav__list">
<li class="nav__item">
<a
href="1"
class="nav__link is-active"
>
apple
</a>
</li>
<li class="nav__item">
<a
href="2"
class="nav__link"
>
samsung
</a>
</li>
<li class="nav__item">
<a
href="3"
class="nav__link"
>
smartphones
</a>
</li>
<li class="nav__item">
<a
href="4"
class="nav__link"
data-qa="hover"
>
laptops & computers
</a>
</li>
<li class="nav__item">
<a
href="5"
class="nav__link"
>
gadgets
</a>
</li>
<li class="nav__item">
<a
href="6"
class="nav__link"
>
tablets
</a>
</li>
<li class="nav__item">
<a
href="7"
class="nav__link"
>
photo
</a>
</li>
<li class="nav__item">
<a
href="8"
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 @@
html {
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.

You set font-family: Roboto here, but the task requires adding the Google Fonts configuration that selects ONLY the roman style, medium (500) weight and normal width. This violates checklist item: "The Google Fonts Configuration follows requirements (as shown in the referenced image)." Add the appropriate <link> (or @import) that loads only the required Roboto variant so auto-tests pass.

font-size: 12px;
font-weight: 500;
text-transform: uppercase;
background-color: grey;

--color: #00acdc;
}

body {
margin: 0;
}

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

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

.nav {
display: inline-block;

Choose a reason for hiding this comment

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

Since the .header is a flex container, this .nav element is a flex item. Flex items behave like block-level elements, so display: inline-block has no effect here. This line can be safely removed.

}

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

.nav__item {
margin-left: 20px;
}

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

.nav__item:last-child {
margin-right: 0;
}
Comment on lines +48 to +50

Choose a reason for hiding this comment

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

This rule for :last-child is not necessary. You are creating space between items using margin-left, and you correctly remove it from the first item. Since no margin-right is ever applied, there's no need to remove it from the last item.


.nav__link {
text-decoration: none;
color: black;
display: block;
padding: 0;
text-align: center;
line-height: 60px;
}

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

.nav__link.is-active {
color: var(--color);
position: relative;
}

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