-
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
Moyo Header #5376
base: master
Are you sure you want to change the base?
Moyo Header #5376
Changes from 1 commit
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,114 @@ | |
content="ie=edge" | ||
/> | ||
<title>Moyo header</title> | ||
<link | ||
rel="preconnect" | ||
href="https://fonts.googleapis.com" | ||
/> | ||
<link | ||
rel="preconnect" | ||
href="https://fonts.gstatic.com" | ||
crossorigin="anonymous" | ||
/> | ||
|
||
<link | ||
href="https://fonts.googleapis.com/css2?family=Roboto:ital,wght@0,100;0,300;0,400;0,500;0,700;0,900;1,100;1,300;1,400;1,500;1,700;1,900&display=swap" | ||
rel="stylesheet" | ||
/> | ||
|
||
<link | ||
rel="stylesheet" | ||
href="./style.css" | ||
/> | ||
</head> | ||
<body> | ||
<h1>Moyo header</h1> | ||
<header class="header"> | ||
<a | ||
href="#" | ||
class="logo" | ||
> | ||
<img | ||
src="/src/images/logo.png" | ||
alt="Moyo-logo" | ||
/> | ||
</a> | ||
|
||
<nav class="nav"> | ||
<ul class="nav_list"> | ||
<li class="nav_item"> | ||
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. Class name 'nav_item' should be 'nav__item' to maintain BEM naming conventions which represent the meaning of the content and not the styles or tag names. |
||
<a | ||
href="#apple" | ||
class="nav_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. Class name 'nav_link' should be 'nav__link' to maintain BEM naming conventions which represent the meaning of the content and not the styles or tag names. |
||
Apple | ||
</a> | ||
</li> | ||
|
||
<li class="nav_item"> | ||
<a | ||
href="#samsung" | ||
class="nav_link" | ||
> | ||
Samsung | ||
</a> | ||
</li> | ||
|
||
<li class="nav_item"> | ||
<a | ||
href="#smartphones" | ||
class="nav_link" | ||
> | ||
Smartphones | ||
</a> | ||
</li> | ||
|
||
<li class="nav_item"> | ||
<a | ||
href="#laptops-computers" | ||
class="nav_link" | ||
data-qa="hover" | ||
> | ||
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 the |
||
</a> | ||
</li> | ||
|
||
<li class="nav_item"> | ||
<a | ||
href="#gadgets" | ||
class="nav_link" | ||
> | ||
Gadgets | ||
</a> | ||
</li> | ||
|
||
<li class="nav_item"> | ||
<a | ||
href="#tablets" | ||
class="nav_link" | ||
> | ||
Tablets | ||
</a> | ||
</li> | ||
|
||
<li class="nav_item"> | ||
<a | ||
href="#photo" | ||
class="nav_link" | ||
> | ||
Photo | ||
</a> | ||
</li> | ||
|
||
<li class="nav_item"> | ||
<a | ||
href="#video" | ||
class="nav_link" | ||
> | ||
Video | ||
</a> | ||
</li> | ||
</ul> | ||
</nav> | ||
</header> | ||
</body> | ||
</html> |
Original file line number | Diff line number | Diff line change | ||||||||
---|---|---|---|---|---|---|---|---|---|---|
@@ -1,3 +1,74 @@ | ||||||||||
body { | ||||||||||
* { | ||||||||||
margin: 0; | ||||||||||
padding: 0; | ||||||||||
box-sizing: border-box; | ||||||||||
list-style: none; | ||||||||||
} | ||||||||||
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 |
||||||||||
|
||||||||||
a { | ||||||||||
text-decoration: none; | ||||||||||
color: inherit; | ||||||||||
} | ||||||||||
|
||||||||||
html { | ||||||||||
font-size: 16px; | ||||||||||
font-family: Roboto, sans-serif; | ||||||||||
font-style: normal; | ||||||||||
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, |
||||||||||
} | ||||||||||
|
||||||||||
.header { | ||||||||||
display: flex; | ||||||||||
align-items: center; | ||||||||||
justify-content: space-between; | ||||||||||
max-width: 1200px; | ||||||||||
margin: 0 auto; | ||||||||||
padding: 0 50px; | ||||||||||
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
|
||||||||||
} | ||||||||||
|
||||||||||
.logo { | ||||||||||
display: block; | ||||||||||
height: 40px; | ||||||||||
width: 40px; | ||||||||||
} | ||||||||||
|
||||||||||
.nav_list { | ||||||||||
display: flex; | ||||||||||
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. Class names should represent the meaning of the content, not the styles or tag names. Here, |
||||||||||
} | ||||||||||
|
||||||||||
.nav_item { | ||||||||||
color: black; | ||||||||||
} | ||||||||||
|
||||||||||
.nav_item:not(:last-child) { | ||||||||||
margin-right: 20px; | ||||||||||
} | ||||||||||
|
||||||||||
.nav_item:hover { | ||||||||||
color: #00acdc; | ||||||||||
} | ||||||||||
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. Create a variable for repeated color and use it everywhere |
||||||||||
|
||||||||||
.nav_link { | ||||||||||
position: relative; | ||||||||||
display: flex; | ||||||||||
align-items: center; | ||||||||||
height: 60px; | ||||||||||
margin: auto; | ||||||||||
text-transform: uppercase; | ||||||||||
font-size: 12px; | ||||||||||
line-height: 16px; | ||||||||||
font-weight: 500; | ||||||||||
} | ||||||||||
|
||||||||||
.is-active { | ||||||||||
color: #00acdc; | ||||||||||
} | ||||||||||
|
||||||||||
.is-active::after { | ||||||||||
content: ''; | ||||||||||
position: absolute; | ||||||||||
width: 100%; | ||||||||||
height: 4px; | ||||||||||
bottom: 0; | ||||||||||
left: 0; | ||||||||||
background-color: #00acdc; | ||||||||||
} |
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.
Class name 'nav_list' should be 'nav__list' to maintain BEM naming conventions which represent the meaning of the content and not the styles or tag names.