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

add task solution #5957

Open
wants to merge 2 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
59 changes: 58 additions & 1 deletion src/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,65 @@
rel="stylesheet"
href="./style.css"
/>
<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@500&display=swap"
rel="stylesheet"
/>
</head>
<body>
<h1>Moyo header</h1>
<header class="header">
<div class="header__logo">
<img
src="images/logo.png"
alt="logo"
/>
</div>
<nav class="menu">
<ul class="menu__list">
<li class="menu__list-item">
<a
href="#"
class="is-active"
>
Apple
</a>
</li>
<li class="menu__list-item">
<a href="#">Samsung</a>
</li>
<li class="menu__list-item">
<a href="#">Smartphones</a>
</li>
<li class="menu__list-item">
<a
href="#"
data-qa="hover"
Comment on lines +58 to +60

Choose a reason for hiding this comment

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

The data-qa attribute is typically used for testing purposes, such as identifying elements in automated tests. Ensure this is necessary for your project requirements. If not, it can be removed to clean up the code.

>
Laptops & Computers
</a>
</li>
<li class="menu__list-item">
<a href="#">Gadgets</a>
</li>
<li class="menu__list-item">
<a href="#">Tablets</a>
</li>
<li class="menu__list-item">
<a href="#">Photo</a>
</li>
<li class="menu__list-item">
<a href="#">Video</a>
</li>
</ul>
</nav>
</header>
</body>
</html>
65 changes: 65 additions & 0 deletions src/style.css
Original file line number Diff line number Diff line change
@@ -1,3 +1,68 @@
body {
margin: 0;
font-family: Roboto, serif;
}

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

.header__logo {
height: 40px;
}

.menu__logo {
list-style-type: none;
}

Choose a reason for hiding this comment

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

The class .menu__logo is defined here but not used in the HTML file. If this class is not needed, consider removing it to keep the CSS clean and maintainable.


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

.menu__list-item {
margin-right: 20px;
}

.menu__list-item a {
color: #000;
text-decoration: none;
text-transform: uppercase;
font-size: 12px;
font-weight: 500;
line-height: 60px;
position: relative;
height: 60px;
display: inline-block;
}

.menu__list-item:last-child {
margin-right: 0;
}

.menu__list-item a:hover {
color: #00acdc;
}

a.is-active {
color: #00acdc !important;
}

a.is-active::after {
content: '';
position: absolute;
left: 0;
bottom: 0; /* Расстояние от текста до линии */
width: 100%;
height: 4px;
background-color: #00acdc;
transform: scaleX(1);
transform-origin: center;
transition: transform 0.3s ease-in-out;
border-radius: 8px;
}
Loading