-
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
Ready header moyon #5388
base: master
Are you sure you want to change the base?
Ready header moyon #5388
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
|
@@ -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" | ||||||
> | ||||||
<img | ||||||
src="./images/logo.png" | ||||||
alt="moyo logo" | ||||||
Comment on lines
+33
to
+39
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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" | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. why do you need so many classes
Suggested change
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. |
||||||
href="#Apple" | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Anchor links should start with the |
||||||
> | ||||||
Apple | ||||||
</a> | ||||||
Comment on lines
+45
to
+50
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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" | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
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" | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Don't use spaces in |
||||||
> | ||||||
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> |
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
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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; | ||||||||||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
better to use padding here instead of a margin |
||||||||||||||||
display: flex; | ||||||||||||||||
justify-content: space-between; | ||||||||||||||||
Comment on lines
+49
to
+55
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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; | ||||||||||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. |
||||||||||||||||
} | ||||||||||||||||
|
||||||||||||||||
.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; | ||||||||||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||||||||||||
margin: 0; | ||||||||||||||||
content: ''; | ||||||||||||||||
width: 100%; | ||||||||||||||||
height: 4px; | ||||||||||||||||
border-radius: 2px; | ||||||||||||||||
background: var(--accent-gray); | ||||||||||||||||
} |
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 spaces in
<a>
tag'shref
property. Thehref
attribute should not point to theindex.html
itself as it is unnecessary. If you intend to link to the top of the page, usehref="#"
.