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

Ready header moyon #5388

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
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
93 changes: 92 additions & 1 deletion src/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,103 @@
content="ie=edge"
/>
<title>Moyo header</title>
<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"
/>
<link
rel="stylesheet"
href="./style.css"
/>
</head>
<body>
<h1>Moyo header</h1>
<header class="header">
<a
class="link"
href="../src/index.html"

Choose a reason for hiding this comment

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

Don't use spaces in <a> tag's href property. The href attribute should not point to the index.html itself as it is unnecessary. If you intend to link to the top of the page, use href="#".

>
<img
src="./images/logo.png"
alt="moyo logo"
Comment on lines +33 to +39

Choose a reason for hiding this comment

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

Keep your attributes correctly formatted. When an HTML element has multiple attributes, each attribute should start on a new line with 2-space indentation related to the tag.

/>
</a>
<nav class="page-navigation">
<ul class="menu list">
<li class="menu-item">
<a
class="menu-link nav-link link is-active"

Choose a reason for hiding this comment

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

why do you need so many classes

Suggested change
class="menu-link nav-link link is-active"
class="nav-link is-active"

Choose a reason for hiding this comment

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

if the element has an is-active class then this element should have that line and a blue color
image

href="#Apple"

Choose a reason for hiding this comment

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

Anchor links should start with the # symbol followed by the id of the element you want to link to. The value #Apple should be in lowercase to match the id exactly, use #apple instead.

>
Apple
</a>
Comment on lines +45 to +50

Choose a reason for hiding this comment

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

Keep your attributes correctly formatted as you did in lines 33-39. Each attribute should start on a new line with 2-space indentation.

</li>
<li class="menu-item">
<a
class="menu-link nav-link link"

Choose a reason for hiding this comment

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

Suggested change
class="menu-link nav-link link"
class="nav-link"

href="#Samsung"
>
Samsung
</a>
</li>
<li class="menu-item">
<a
class="menu-link nav-link link"
href="#Smartphones"
>
Smartphones
</a>
</li>
<li class="menu-item">
<a
class="menu-link nav-link link"
data-qa="hover"
href="#Laptops-Computers"

Choose a reason for hiding this comment

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

Don't use spaces in <a> tag's href property. Instead of #Laptops-Computers, use #laptops-computers (all lowercase) to ensure consistency.

>
Laptops & Computers
</a>
</li>
<li class="menu-item">
<a
class="menu-link nav-link link"
href="#Gadgets"
>
Gadgets
</a>
</li>
<li class="menu-item">
<a
class="menu-link nav-link link"
href="#Tablets"
>
Tablets
</a>
</li>
<li class="menu-item">
<a
class="menu-link nav-link link"
href="#Photo"
>
Photo
</a>
</li>
<li class="menu-item">
<a
class="menu-link nav-link link"
href="#Video"
>
Video
</a>
</li>
</ul>
</nav>
</header>
</body>
</html>
88 changes: 88 additions & 0 deletions src/style.css
Original file line number Diff line number Diff line change
@@ -1,3 +1,91 @@
h1,
h2,
h3,
h4,
h5,
h6,
p {
margin-top: 0;
margin-bottom: 0;
Comment on lines +1 to +9

Choose a reason for hiding this comment

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

Be consistent with your vertical margins (Add only top or only bottom margin, but not both). It's best to pick one direction (either top or bottom) for vertical margins to prevent issues with margin collapsing and to maintain consistency throughout the stylesheet.

}

ul,
ol {
padding-left: 0;
margin-top: 0;
margin-bottom: 0;
Comment on lines +12 to +16

Choose a reason for hiding this comment

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

Similar to the previous comment, be consistent with your vertical margins for lists. Choose either top or bottom margin to apply to your elements.

}

button {
cursor: pointer;
}

body {
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.

Remember to use fallback fonts - alternative font-family in case the main one doesn't work. For example, 'font-family: Roboto, Arial, sans-serif;' ensures that if 'Roboto' is not available, the browser will try to use 'Arial' before falling back to the default 'sans-serif' font.

font-size: 16px;
text-transform: uppercase;
line-height: 1.5;
letter-spacing: 0.02em;
}

img {
display: block;
max-width: 100%;
}

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

.link {
text-decoration: none;
}

:root {
--pressed: black;
--accent-gray: #00acdc;
}

.header {
padding-top: 10px;
padding-bottom: 10px;
margin-right: 50px;
margin-left: 50px;
Comment on lines +49 to +53

Choose a reason for hiding this comment

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

Suggested change
.header {
padding-top: 10px;
padding-bottom: 10px;
margin-right: 50px;
margin-left: 50px;
.header {
padding: 0 50px;

better to use padding here instead of a margin
padding is applied inside the element, whereas margins affect the space outside the element.

display: flex;
justify-content: space-between;
Comment on lines +49 to +55

Choose a reason for hiding this comment

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

Don't fix container size (if there is no such a requirement). In this case, setting explicit margins might not be necessary if you want the container to be sized by its content. If there's no requirement for fixed margins, consider using padding within the container or setting max-width instead.

}

.menu {
display: flex;
gap: 20px;

Choose a reason for hiding this comment

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

image

}

.menu-link {
color: var(--pressed);
letter-spacing: 0.02em;
font-weight: 500;
}

.menu-link:hover,
.menu-link:focus,
.menu-link:active {
color: var(--accent-gray);
}

.nav-link {
position: relative;
}

.nav-link:hover::after,
.nav-link:focus::after,
.nav-link:active::after {
position: absolute;
left: 0;
bottom: -18px;

Choose a reason for hiding this comment

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

Suggested change
bottom: -18px;
bottom: 0;

margin: 0;
content: '';
width: 100%;
height: 4px;
border-radius: 2px;
background: var(--accent-gray);
}
Loading