-
Notifications
You must be signed in to change notification settings - Fork 4.6k
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
task solution #5381
base: master
Are you sure you want to change the base?
task solution #5381
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 |
---|---|---|
@@ -1,14 +1,22 @@ | ||
<!doctype html> | ||
<html lang="en"> | ||
<head> | ||
<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: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" | ||
/> | ||
<meta charset="UTF-8" /> | ||
<meta | ||
name="viewport" | ||
content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0" | ||
/> | ||
<meta | ||
http-equiv="X-UA-Compatible" | ||
content="ie=edge" | ||
content="width=device-width, initial-scale=1.0" | ||
/> | ||
<title>Moyo header</title> | ||
<link | ||
|
@@ -17,6 +25,87 @@ | |
/> | ||
</head> | ||
<body> | ||
<h1>Moyo header</h1> | ||
<header class="header"> | ||
<a | ||
href="/" | ||
class="logo-link" | ||
> | ||
<img | ||
src="images/logo.png" | ||
alt="MOYO Electronics Brand Logo'" | ||
class="logo" | ||
/> | ||
</a> | ||
|
||
<nav class="nav"> | ||
<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"> | ||
<a | ||
href="#laptops-computers" | ||
class="nav__link" | ||
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. Don't use spaces in |
||
> | ||
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,89 @@ | ||
body { | ||
:root { | ||
--main-color: #00acdc; | ||
} | ||
|
||
ul, | ||
ol { | ||
padding: 0; | ||
} | ||
|
||
Comment on lines
+5
to
+8
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 tag names for styling (except |
||
body, | ||
h1, | ||
h2, | ||
h3, | ||
h4, | ||
p, | ||
ul, | ||
ol, | ||
li, | ||
figure, | ||
figcaption, | ||
blockquote, | ||
dl, | ||
dd { | ||
margin: 0; | ||
list-style: none; | ||
} | ||
|
||
Comment on lines
+10
to
+26
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. Avoid using tag names for styling. It's better to use classes to avoid unintended side effects on other elements of the same type. For example, you might not want all |
||
html { | ||
font-family: Roboto, Arial, 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 instance, 'Roboto', 'Arial', sans-serif could be specified as 'Roboto', 'Arial', 'Helvetica', sans-serif. |
||
|
||
.logo { | ||
display: block; | ||
width: 40px; | ||
height: 40px; | ||
} | ||
|
||
.nav__item { | ||
margin-right: 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. Be consistent with your vertical margins. It's recommended to add only top or only bottom margin, but not both, to prevent issues with margin collapse. In this case, consider using only |
||
|
||
.nav__item:last-child { | ||
margin-right: 0; | ||
} | ||
|
||
Comment on lines
+38
to
+44
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. You're adding right margin to |
||
.header { | ||
display: flex; | ||
align-items: center; | ||
justify-content: space-between; | ||
padding: 0 50px; | ||
} | ||
|
||
.nav__list { | ||
list-style: none; | ||
display: flex; | ||
} | ||
|
||
.nav__link { | ||
height: 60px; | ||
display: flex; | ||
justify-content: center; | ||
align-items: center; | ||
text-align: center; | ||
font-weight: 500; | ||
font-size: 12px; | ||
text-transform: uppercase; | ||
color: #000; | ||
text-decoration: none; | ||
} | ||
|
||
.nav__link:hover { | ||
color: var(--main-color); | ||
} | ||
|
||
.is-active { | ||
color: var(--main-color); | ||
position: relative; | ||
} | ||
|
||
.is-active::after { | ||
display: block; | ||
position: absolute; | ||
content: ''; | ||
bottom: 0; | ||
height: 4px; | ||
width: 100%; | ||
border-radius: 8px; | ||
background-color: var(--main-color); | ||
} |
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
alt
attribute should describe the image content, but avoid using special characters like single quotes at the end unless they are part of the actual description. It should bealt="MOYO Electronics Brand Logo"
.