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

Develop #5380

Open
wants to merge 15 commits into
base: master
Choose a base branch
from
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://Krrampuss.github.io/layout_moyo-header/)
- [TEST REPORT LINK](https://Krrampuss.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
98 changes: 95 additions & 3 deletions src/index.html
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
<!doctype html>
<html lang="en">
<html
class="html"
lang="en"
Comment on lines +2 to +4

Choose a reason for hiding this comment

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

The class attribute on the html tag is not necessary unless it's being used for a specific purpose in CSS or JavaScript. If it's not used, it's better to remove it to keep the markup clean.

>
<head>
<meta charset="UTF-8" />
<meta
Expand All @@ -15,8 +18,97 @@
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:ital,wght@0,500&display=swap"
rel="stylesheet"
/>
</head>
<body>
<h1>Moyo header</h1>
<body class="body">
<header class="header">
<a href="#">
<img
class="img"
src="images/logo.png"
alt="MOYO_main_logo"
Comment on lines +36 to +40

Choose a reason for hiding this comment

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

The href attribute in the anchor tag should not be empty or contain just '#'. If this is a placeholder, consider adding a comment or using a more descriptive placeholder. Also, the alt attribute should describe the image content, 'MOYO_main_logo' could be more descriptive to improve accessibility and SEO.

/>
</a>
<nav class="nav">
<ul class="nav__list">
<li class="nav__item">
<a
class="nav__link is-active"
href="#"
>
Comment on lines +46 to +49

Choose a reason for hiding this comment

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

Avoid using spaces in the href attribute of an anchor tag. Anchor links should start with the # symbol followed by a meaningful identifier corresponding to an id of an element on the page.

Apple
</a>
</li>
<li class="nav__item">
<a
class="nav__link"
href="#"
>
Samsung
</a>
</li>
<li class="nav__item">
<a
class="nav__link"
href="#"
>
Smartphones
</a>
</li>
<li class="nav__item">
<a
class="nav__link"
data-qa="hover"
href="#"
>
Laptops & Computers
</a>
</li>
<li class="nav__item">
<a
class="nav__link"
href="#"
>
Gadgets
</a>
</li>
<li class="nav__item">
<a
class="nav__link"
href="#"
>
Tablets
</a>
</li>
<li class="nav__item">
<a
class="nav__link"
href="#"
>
Photo
</a>
</li>
<li class="nav__item">
<a
class="nav__link"
href="#"
>
Video
</a>
</li>
</ul>
</nav>
</header>
</body>
</html>
70 changes: 69 additions & 1 deletion src/style.css
Original file line number Diff line number Diff line change
@@ -1,3 +1,71 @@
body {
* {
margin: 0;
padding: 0;
}

Comment on lines +1 to +4

Choose a reason for hiding this comment

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

Don't use * selector (it impacts performance). Set styles only for elements that require them. Instead, you can set margin: 0 and padding: 0 in the body tag if you need to reset the default browser styling.

.html {
--header-link-color: #00acdc;
}

Comment on lines +6 to +8

Choose a reason for hiding this comment

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

It's not common practice to create a class named .html. If you want to define CSS variables or set styles for the entire document, you should place them within the :root selector.

.body {
margin: 0;
}

Comment on lines +10 to +12

Choose a reason for hiding this comment

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

Similar to the .html class, it is unusual to have a .body class. If you are trying to style the <body> element, you should use the body tag selector.

.img {
display: block;
}

Comment on lines +14 to +16

Choose a reason for hiding this comment

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

Avoid using tag names for styling like .img. If you need to apply a style to all <img> elements, it's better to use the img tag directly, unless there's a specific reason to use a class.

.header {
display: flex;
justify-content: space-between;
align-items: center;
padding: 0 50px;
font-family: Roboto, sans-serif;
font-size: 12px;

Choose a reason for hiding this comment

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

Remember to use fallback fonts - alternative font-family in case the main one doesn't work. For example, font-family: Roboto, Arial, sans-serif;.

font-weight: 500;
}

.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 {
display: flex;
align-items: center;
height: 60px;
color: #000;
text-decoration: none;
text-transform: uppercase;
}

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

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

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