-
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
add solution #5613
base: master
Are you sure you want to change the base?
add solution #5613
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 |
---|---|---|
|
@@ -15,8 +15,110 @@ | |
rel="stylesheet" | ||
href="./style.css" | ||
/> | ||
|
||
<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" | ||
/> | ||
</head> | ||
<body> | ||
<h1>Moyo header</h1> | ||
<header class="header"> | ||
<a | ||
href="#" | ||
class="img" | ||
> | ||
<img | ||
src="./images/logo.png" | ||
alt="Logo" | ||
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. Ensure that the |
||
/> | ||
</a> | ||
|
||
<nav class="nav"> | ||
<ul class="nav__list"> | ||
<li class="nav__item"> | ||
<a | ||
href="#" | ||
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. The |
||
> | ||
APPLE | ||
</a> | ||
</li> | ||
|
||
<li class="nav__item"> | ||
<a | ||
href="#" | ||
class="nav__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. Similar to previous comments, ensure the |
||
> | ||
SAMSUNG | ||
</a> | ||
</li> | ||
|
||
<li class="nav__item"> | ||
<a | ||
href="#" | ||
class="nav__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. Ensure the |
||
> | ||
SMARTPHONES | ||
</a> | ||
</li> | ||
|
||
<li | ||
class="nav__item" | ||
data-qa="hover" | ||
> | ||
<a | ||
href="#" | ||
class="nav__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. The |
||
> | ||
LAPTOPS & COMPUTERS | ||
</a> | ||
</li> | ||
|
||
<li class="nav__item"> | ||
<a | ||
href="#" | ||
class="nav__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. Consider updating the |
||
> | ||
GADGETS | ||
</a> | ||
</li> | ||
|
||
<li class="nav__item"> | ||
<a | ||
href="#" | ||
class="nav__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. Ensure the |
||
> | ||
TABLETS | ||
</a> | ||
</li> | ||
|
||
<li class="nav__item"> | ||
<a | ||
href="#" | ||
class="nav__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. The |
||
> | ||
PHOTO | ||
</a> | ||
</li> | ||
|
||
<li class="nav__item"> | ||
<a | ||
href="#" | ||
class="nav__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. Consider updating the |
||
> | ||
VIDEO | ||
</a> | ||
</li> | ||
</ul> | ||
</nav> | ||
</header> | ||
</body> | ||
</html> |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,65 @@ | ||
body { | ||
--color: #00acdc; | ||
|
||
font-family: Roboto, 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. Consider using a more specific font stack for better fallback options. For example, 'Roboto, Arial, sans-serif' would provide a more consistent appearance across different browsers and systems. |
||
margin: 0; | ||
padding: 0; | ||
box-sizing: border-box; | ||
} | ||
|
||
.header { | ||
width: 100%; | ||
display: flex; | ||
justify-content: space-between; | ||
align-items: center; | ||
} | ||
|
||
.nav__link { | ||
font-size: 12px; | ||
text-decoration: none; | ||
color: black; | ||
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. Using a specific color like 'black' can be inflexible. Consider using a CSS variable or a more flexible color scheme to allow for easier theme changes in the future. |
||
padding-top: 22px; | ||
padding-bottom: 22px; | ||
} | ||
|
||
.nav__list { | ||
list-style-type: none; | ||
display: flex; | ||
flex-wrap: nowrap; | ||
} | ||
|
||
.nav__item { | ||
font-weight: 500; | ||
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 font-weight of 500 might not be supported by all fonts. Ensure that the 'Roboto' font includes this weight or consider using a more common weight like 400 or 600. |
||
text-transform: uppercase; | ||
margin-right: 20px; | ||
} | ||
|
||
.nav { | ||
padding-right: 30px; | ||
} | ||
|
||
.img { | ||
height: 40px; | ||
width: 40px; | ||
margin-top: 10px; | ||
margin-left: 50px; | ||
} | ||
|
||
.is-active { | ||
position: relative; | ||
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 use of 'position: relative;' on '.is-active' suggests that there might be positioned children. Ensure this is necessary for the intended design, as it can affect layout in unexpected ways. |
||
} | ||
|
||
.is-active::after { | ||
position: absolute; | ||
content: ''; | ||
left: 0; | ||
width: 100%; | ||
bottom: 0; | ||
height: 4px; | ||
background-color: var(--color); | ||
border-radius: 10px; | ||
} | ||
|
||
.nav__link:hover { | ||
color: var(--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.
Consider adding a more descriptive
href
attribute for the anchor tag instead of#
. This will improve accessibility and usability by providing a meaningful link destination.