-
Notifications
You must be signed in to change notification settings - Fork 4.8k
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
fixed moyo header #5394
fixed moyo header #5394
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It looks like you've made a great effort with your code! 👍 However, there are a few issues that need to be addressed before we can approve the pull request. Please take a look at the comments about using fallback fonts, avoiding fixed container sizes, not using the *
selector for performance reasons, fixing the href
attribute, improving code readability with empty lines, proper attribute formatting, and indentation. Once you've made these adjustments, your code will be even better! Keep up the good work, and let's get these changes made! 💪
✨ Please rate this review in the Platform's notification center. I will be grateful for your feedback! ✨
src/index.html
Outdated
<header class="main-header"> | ||
<a | ||
href="#" | ||
class="logo" | ||
> | ||
<img | ||
src="images/logo.png" | ||
alt="Company Logo" | ||
/> | ||
</a> | ||
<nav> | ||
<ul class="nav-menu"> | ||
<li> | ||
<a | ||
href="#" | ||
class="nav-link is-active" | ||
> | ||
APPLE | ||
</a> | ||
</li> | ||
<li> | ||
<a | ||
href="#" | ||
class="nav-link" | ||
> | ||
SAMSUNG | ||
</a> | ||
</li> | ||
<li> | ||
<a | ||
href="#" | ||
class="nav-link" | ||
> | ||
SMARTPHONES | ||
</a> | ||
</li> | ||
<li> | ||
<a | ||
href="#" | ||
class="nav-link" | ||
data-qa="hover" | ||
> | ||
LAPTOPS & COMPUTERS | ||
</a> | ||
</li> | ||
<li> | ||
<a | ||
href="#" | ||
class="nav-link" | ||
> | ||
GADGETS | ||
</a> | ||
</li> | ||
<li> | ||
<a | ||
href="#" | ||
class="nav-link" | ||
> | ||
TABLETS | ||
</a> | ||
</li> | ||
<li> | ||
<a | ||
href="#" | ||
class="nav-link" | ||
> | ||
PHOTO | ||
</a> | ||
</li> | ||
<li> | ||
<a | ||
href="#" | ||
class="nav-link" | ||
> | ||
VIDEO | ||
</a> | ||
</li> | ||
</ul> | ||
</nav> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Remember to add empty lines between multiline sibling blocks of HTML. There should be an empty line between the <a>
and <nav>
tags to improve readability.
<a | ||
href="#" | ||
class="logo" | ||
> | ||
<img | ||
src="images/logo.png" | ||
alt="Company Logo" | ||
/> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Each attribute should start on a new line with 2-space indentation when there are more than two attributes or attribute values are long. This applies to the <a>
tag on lines 21-24 and the <img>
tag on lines 25-28.
src/index.html
Outdated
<li> | ||
<a | ||
href="#" | ||
class="nav-link is-active" | ||
> | ||
APPLE | ||
</a> | ||
</li> | ||
<li> | ||
<a | ||
href="#" | ||
class="nav-link" | ||
> | ||
SAMSUNG | ||
</a> | ||
</li> | ||
<li> | ||
<a | ||
href="#" | ||
class="nav-link" | ||
> | ||
SMARTPHONES | ||
</a> | ||
</li> | ||
<li> | ||
<a | ||
href="#" | ||
class="nav-link" | ||
data-qa="hover" | ||
> | ||
LAPTOPS & COMPUTERS | ||
</a> | ||
</li> | ||
<li> | ||
<a | ||
href="#" | ||
class="nav-link" | ||
> | ||
GADGETS | ||
</a> | ||
</li> | ||
<li> | ||
<a | ||
href="#" | ||
class="nav-link" | ||
> | ||
TABLETS | ||
</a> | ||
</li> | ||
<li> | ||
<a | ||
href="#" | ||
class="nav-link" | ||
> | ||
PHOTO | ||
</a> | ||
</li> | ||
<li> | ||
<a | ||
href="#" | ||
class="nav-link" | ||
> | ||
VIDEO | ||
</a> | ||
</li> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Add empty lines between multiline sibling elements. There should be an empty line between each <li>
block to improve readability.
<a | ||
href="#" | ||
class="nav-link is-active" | ||
> | ||
APPLE | ||
</a> |
There was a problem hiding this comment.
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 <a>
tag should not contain spaces. Use a meaningful reference or #
if the link is a placeholder.
src/index.html
Outdated
</body> | ||
</html> | ||
|
||
</html> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Remove the duplicate closing </html>
tag. There should only be one closing </html>
tag at the end of the document.
src/style.css
Outdated
* { | ||
margin: 0; | ||
padding: 0; | ||
box-sizing: border-box; | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Don't use the *
selector as it impacts the performance. Set styles only for elements that require them. Zeroing out your margins, paddings, or other styles with *
is still inefficient for the browser.
src/style.css
Outdated
.main-header { | ||
width: 100%; | ||
height: 60px; | ||
display: flex; | ||
justify-content: space-between; | ||
align-items: center; | ||
background-color: #fff; | ||
padding: 0 50px; | ||
border-bottom: 1px solid #ddd; | ||
position: relative; | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Don't fix container sizes like width
and height
unless there is a specific requirement for that. Let the content size dictate the container's size to avoid overflow or accidental scroll bars.
src/style.css
Outdated
body { | ||
font-family: Roboto, sans-serif; | ||
background-color: #f9f9f9; | ||
} |
There was a problem hiding this comment.
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;
.
[х] Header height is set in 1 place (for the links)
[х] Content is vertically centered (for any header height)
[х] CSS is used to show all letters in Uppercase (don't type them in HTML)
[х] Logo is an image wrapped with a link
[х] CSS Variable is used for a blue color
[х] Pseudo-element is used for a blue line below the active link
[х] Code follows all the Code Style Rules ❗️