-
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
New solution #5387
base: master
Are you sure you want to change the base?
New solution #5387
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,111 @@ | |||||||||||
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@400;500&display=swap" | ||||||||||||
rel="stylesheet" | ||||||||||||
/> | ||||||||||||
<link | ||||||||||||
rel="stylesheet" | ||||||||||||
href="./style.css" | ||||||||||||
/> | ||||||||||||
</head> | ||||||||||||
<body> | ||||||||||||
<h1>Moyo header</h1> | ||||||||||||
<header class="header"> | ||||||||||||
<a | ||||||||||||
href="#" | ||||||||||||
class="header__link" | ||||||||||||
> | ||||||||||||
<img | ||||||||||||
class="header__logo" | ||||||||||||
src="./images/logo.png" | ||||||||||||
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 |
||||||||||||
alt="logo" | ||||||||||||
/> | ||||||||||||
Comment on lines
+33
to
+41
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. If the HTML element has long attribute values or more than 2 attributes, start each one, including the first, on a new line with 2-space indentation related to the tag. |
||||||||||||
</a> | ||||||||||||
Comment on lines
+32
to
+42
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 about correct indentation between parent and child elements. The |
||||||||||||
|
||||||||||||
<nav class="nav"> | ||||||||||||
<ul class="nav__list"> | ||||||||||||
<li class="nav__item"> | ||||||||||||
<a | ||||||||||||
href="#" | ||||||||||||
class="nav__link is-active" | ||||||||||||
> | ||||||||||||
Apple | ||||||||||||
</a> | ||||||||||||
</li> | ||||||||||||
|
||||||||||||
<li class="nav__item"> | ||||||||||||
<a | ||||||||||||
href="#" | ||||||||||||
class="nav__link" | ||||||||||||
> | ||||||||||||
Samsung | ||||||||||||
</a> | ||||||||||||
</li> | ||||||||||||
<li class="nav__item"> | ||||||||||||
Comment on lines
+62
to
+63
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. Add the blank line between the all links
Suggested change
|
||||||||||||
<a | ||||||||||||
href="#" | ||||||||||||
class="nav__link" | ||||||||||||
> | ||||||||||||
Smartphones | ||||||||||||
</a> | ||||||||||||
</li> | ||||||||||||
|
||||||||||||
<li class="nav__item"> | ||||||||||||
<a | ||||||||||||
href="#" | ||||||||||||
class="nav__link" | ||||||||||||
data-qa="hover" | ||||||||||||
> | ||||||||||||
Laptops & Computers | ||||||||||||
</a> | ||||||||||||
</li> | ||||||||||||
|
||||||||||||
<li class="nav__item"> | ||||||||||||
<a | ||||||||||||
href="#" | ||||||||||||
class="nav__link" | ||||||||||||
> | ||||||||||||
Gadgets | ||||||||||||
</a> | ||||||||||||
</li> | ||||||||||||
|
||||||||||||
<li class="nav__item"> | ||||||||||||
<a | ||||||||||||
href="#" | ||||||||||||
class="nav__link" | ||||||||||||
> | ||||||||||||
Tablets | ||||||||||||
</a> | ||||||||||||
</li> | ||||||||||||
|
||||||||||||
<li class="nav__item"> | ||||||||||||
<a | ||||||||||||
href="#" | ||||||||||||
class="nav__link" | ||||||||||||
> | ||||||||||||
Photo | ||||||||||||
</a> | ||||||||||||
</li> | ||||||||||||
|
||||||||||||
<li class="nav__item"> | ||||||||||||
<a | ||||||||||||
href="#" | ||||||||||||
class="nav__link" | ||||||||||||
> | ||||||||||||
Video | ||||||||||||
</a> | ||||||||||||
</li> | ||||||||||||
</ul> | ||||||||||||
</nav> | ||||||||||||
Comment on lines
+44
to
+118
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. Add empty lines between multiline sibling blocks of HTML to add some 'air' and simplify reading. But don't add them between parent and child elements. |
||||||||||||
</header> | ||||||||||||
</body> | ||||||||||||
</html> |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,79 @@ | ||
body { | ||
margin: 0; | ||
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. It's good practice to specify a fallback font-family, in case the primary font cannot be loaded. Consider adding a generic font family as a fallback. 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. Move font styles to the html selector |
||
font-weight: 500; | ||
} | ||
|
||
a { | ||
text-decoration: none; | ||
color: black; | ||
} | ||
|
||
.header { | ||
display: flex; | ||
justify-content: space-between; | ||
align-items: center; | ||
padding: 0 50px; | ||
box-shadow: 0 2px 4 px rgba(0 0 0 0.05); | ||
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. There is a syntax error in the |
||
} | ||
|
||
.header__link { | ||
display: block; | ||
height: 40px; | ||
width: 40px; | ||
} | ||
|
||
.header__logo { | ||
height: 100%; | ||
width: 100%; | ||
} | ||
|
||
.nav { | ||
display: block; | ||
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 |
||
} | ||
|
||
.nav__list { | ||
display: flex; | ||
padding: 0; | ||
margin: 0; | ||
list-style: none; | ||
} | ||
|
||
.nav__item { | ||
margin-left: 20px; | ||
} | ||
|
||
.nav__item:first-child { | ||
margin-left: 0; | ||
} | ||
|
||
.is-active { | ||
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 |
||
} | ||
|
||
.is-active::after { | ||
content: ''; | ||
position: absolute; | ||
bottom: 0; | ||
left: 0; | ||
right: 0; | ||
height: 4px; | ||
border-radius: 2px; | ||
background-color: #00acdc; | ||
} | ||
|
||
.nav__link { | ||
position: relative; | ||
display: flex; | ||
align-items: center; | ||
height: 60px; | ||
font-family: Roboto, sans-serif; | ||
font-size: 12px; | ||
font-weight: 500; | ||
white-space: nowrap; | ||
text-transform: uppercase; | ||
} | ||
|
||
.nav__link:hover { | ||
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.
Don't use spaces in
<a>
tag'shref
property. Anchor links should start with the#
symbol and should not have spaces.