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
26 changes: 20 additions & 6 deletions src/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,26 @@
content="ie=edge"
/>
<title>Moyo header</title>
<link
rel="stylesheet"
href="./style.css"
/>
</head>
<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="/" class="header__logo">
<img src="images/logo.png" alt="Moyo Logo">
</a>
<nav class="nav">
<ul class="nav__list">
<li class="nav__item"><a class="nav__link is-active" href="#Apple">Apple</a></li>
<li class="nav__item"><a class="nav__link" href="#Samsung">Samsung</a></li>
<li class="nav__item"><a class="nav__link" href="#Smartphones">Smartphones</a></li>
<li class="nav__item"><a class="nav__link" href="#laptops-and-computers" data-qa="hover">Laptops & Computers</a></li>
<li class="nav__item"><a class="nav__link" href="#Gadgets">Gadgets</a></li>
<li class="nav__item"><a class="nav__link" href="#Tablets">Tablets</a></li>
<li class="nav__item"><a class="nav__link" href="#Photo">Photo</a></li>
<li class="nav__item"><a class="nav__link" href="#Video">Video</a></li>
</ul>
</nav>
</header>
</body>
</html>
57 changes: 57 additions & 0 deletions src/style.css
Original file line number Diff line number Diff line change
@@ -1,3 +1,60 @@
:root {
--color-blue: #00acdc;
}

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

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

.nav__link {
text-transform: uppercase;
color: inherit;
white-space: nowrap;
outline: none;
text-decoration: none;
font-size: 12px;
position: relative;
display: block;
line-height: 60px;
}

.nav__link:hover {

Choose a reason for hiding this comment

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

This selector for the hover effect is not working because the <a> elements in the HTML are missing the nav__link class. The same issue applies to the .nav__link.is-active selector on line 43.

color: var(--color-blue);
}

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

.nav__item:not(:last-child) {
margin-right: 20px;
}

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

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