-
Notifications
You must be signed in to change notification settings - Fork 5k
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 task solution #3407
base: master
Are you sure you want to change the base?
Changes from 5 commits
6b821cc
5dadb73
e43245b
e71aa9f
14f50a8
a3a21b8
52d8e65
661b3df
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 |
---|---|---|
|
@@ -9,6 +9,41 @@ | |
<link rel="stylesheet" href="./style.css"> | ||
</head> | ||
<body> | ||
<h1>Moyo header</h1> | ||
<header class="header"> | ||
<a href="#home" class="logo_link"> | ||
<img | ||
src="./images/logo.png" | ||
alt="Moyo Header Logo" | ||
> | ||
</a> | ||
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. Here should be an empty space, this <div>
<span></span>
<p></p>
<div>
<ul>
<li></li>
<li></li>
</ul>
</div>
</div> |
||
<nav class="nav"> | ||
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. When you have repeated tags there is no need for empty lines between them, for example: <ul>
<li></li>
<li></li>
<li></li>
<li></li>
</ul> |
||
<ul class="nav_list"> | ||
<li class="nav_item"> | ||
<a href="#apple" class="nav_link is-active">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" data-qa="hover"> | ||
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. The 'data-qa' attribute has been added to the 'li' element, whereas it should be added to the 4th 'a' link as per the task description. |
||
<a href="#laptops" class="nav_link">Laptops & Computers</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,79 @@ | ||
@import url("https://fonts.googleapis.com/css2?family=Roboto:wght@500&display=swap"); | ||
|
||
:root { | ||
--light-blue: #00acdc; | ||
--black: #000; | ||
} | ||
|
||
html { | ||
font-family: "Roboto", sans-serif; | ||
} | ||
|
||
body { | ||
margin: 0; | ||
} | ||
|
||
.header { | ||
position: relative; | ||
padding: 0 50px; | ||
display: flex; | ||
justify-content: space-between; | ||
align-items: center; | ||
} | ||
|
||
.nav { | ||
display: flex; | ||
} | ||
|
||
.logo_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. This should be enough here, rest is redundant: .logo_link {
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. Bump this Radek mention, you can refactor these styles as suggested |
||
display: block; | ||
width: 40px; | ||
height: 40px; | ||
text-decoration: none; | ||
} | ||
|
||
.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 { | ||
position: relative; | ||
display: flex; | ||
align-items: center; | ||
font-size: 12px; | ||
line-height: 15px; | ||
padding: 23px 0; | ||
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. Use rounded values divisible by 5 as it makes any calculations and positioning much easier. 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. Bump this also, please set this padding value to 22px or 24px |
||
text-transform: uppercase; | ||
color: var(--black); | ||
text-decoration: none; | ||
} | ||
|
||
.nav_link:hover { | ||
color: var(--light-blue); | ||
} | ||
|
||
.nav_link.is-active { | ||
color: var(--light-blue); | ||
} | ||
|
||
.nav_link.is-active::after { | ||
position: absolute; | ||
bottom: 0; | ||
content: ""; | ||
display: block; | ||
width: 100%; | ||
height: 4px; | ||
border-radius: 8px; | ||
background-color: var(--light-blue); | ||
} |
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.
Following the BEM naming convention please add a double underscore instead of one for block elements styles
class="logo__link"
Please change that in the whole project HTML and CSS :)