-
Notifications
You must be signed in to change notification settings - Fork 4.9k
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
Develop #5844
base: master
Are you sure you want to change the base?
Develop #5844
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 |
---|---|---|
|
@@ -15,8 +15,56 @@ | |
rel="stylesheet" | ||
href="./style.css" | ||
/> | ||
<link | ||
rel="preconnect" | ||
href="https://fonts.gstatic.com" | ||
/> | ||
<link | ||
rel="preconnect" | ||
href="https://fonts.googleapis.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> | ||
<a | ||
href="#" | ||
class="logo" | ||
> | ||
<img | ||
src="images/logo.png" | ||
alt="logo" | ||
/> | ||
</a> | ||
<nav> | ||
<ul> | ||
<li> | ||
<a | ||
href="/apple" | ||
class="is-active" | ||
> | ||
Apple | ||
</a> | ||
</li> | ||
<li><a href="/samsung">Samsung</a></li> | ||
<li><a href="/smartphones">Smartphones</a></li> | ||
<li> | ||
<a | ||
href="/laptops" | ||
data-qa="hover" | ||
> | ||
Laptops & Computers | ||
</a> | ||
</li> | ||
<li><a href="/gadgets">Gadgets</a></li> | ||
<li><a href="/tablets">Tablets</a></li> | ||
<li><a href="/photo">Photo</a></li> | ||
<li><a href="/video">Video</a></li> | ||
</ul> | ||
</nav> | ||
</header> | ||
Comment on lines
+32
to
+68
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. For better accessibility, consider using semantic HTML5 elements such as |
||
</body> | ||
</html> |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,76 @@ | ||
:root { | ||
--link-color: #00acdc; | ||
} | ||
|
||
body { | ||
font-family: Roboto, sans-serif; | ||
margin: 0; | ||
line-height: 1; | ||
} | ||
|
||
header { | ||
display: flex; | ||
justify-content: space-between; | ||
align-items: center; | ||
padding: 0 50px; | ||
} | ||
|
||
.logo { | ||
display: flex; | ||
align-items: center; | ||
} | ||
|
||
.logo img { | ||
width: 100%; | ||
height: auto; | ||
Comment on lines
+24
to
+25
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. Setting the width of the logo image to 100% might cause it to stretch if the container size changes. Consider setting a max-width instead to maintain the aspect ratio. |
||
} | ||
|
||
a { | ||
text-transform: uppercase; | ||
color: #000; | ||
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 default link color is set to black ( |
||
display: flex; | ||
align-items: center; | ||
justify-content: center; | ||
height: 60px; | ||
font-size: 12px; | ||
font-weight: 500; | ||
text-decoration: none; | ||
} | ||
|
||
a:hover, | ||
a.is-active { | ||
color: var(--link-color); | ||
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 CSS variables for colors is a good practice. Ensure that |
||
} | ||
|
||
ul { | ||
list-style: none; | ||
display: flex; | ||
position: relative; | ||
margin: 0; | ||
padding: 0; | ||
} | ||
|
||
li { | ||
margin: 0 10px; | ||
position: relative; | ||
} | ||
|
||
ul li:first-child { | ||
margin-left: 0; | ||
} | ||
|
||
ul li:last-child { | ||
margin-right: 0; | ||
} | ||
|
||
a.is-active::after { | ||
content: ''; | ||
background-color: var(--link-color); | ||
border-radius: 4px; | ||
width: 100%; | ||
height: 4px; | ||
display: block; | ||
position: absolute; | ||
bottom: 0; | ||
left: 0; | ||
} |
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
alt
attribute for the logo image to improve accessibility. Instead of just 'logo', you could use something like 'Company Logo' or 'Moyo Logo'.