-
Notifications
You must be signed in to change notification settings - Fork 5.1k
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
Finished moyo_Header #5737
base: master
Are you sure you want to change the base?
Finished moyo_Header #5737
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 |
---|---|---|
|
@@ -6,6 +6,18 @@ | |
name="viewport" | ||
content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0" | ||
/> | ||
<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@100;300;400;500;700&display=swap" | ||
rel="stylesheet" | ||
/> | ||
<meta | ||
http-equiv="X-UA-Compatible" | ||
content="ie=edge" | ||
|
@@ -17,6 +29,85 @@ | |
/> | ||
</head> | ||
<body> | ||
<h1>Moyo header</h1> | ||
<header class="header"> | ||
<a | ||
href=" " | ||
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 |
||
class="logo" | ||
> | ||
<img | ||
src="/src/images/logo.png" | ||
alt="Logo image" | ||
/> | ||
</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" | ||
data-qa="hover" | ||
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 @@ | ||
:root { | ||
--navhover-color: #00acdc; | ||
--header-height: 60px; | ||
} | ||
|
||
html { | ||
font-family: Roboto, sans-serif; | ||
font-size: 12px; | ||
} | ||
|
||
body { | ||
margin: 0; | ||
padding: 0; | ||
} | ||
|
||
.header { | ||
display: flex; | ||
align-items: center; | ||
justify-content: space-between; | ||
padding: 0 50px; | ||
} | ||
|
||
.logo { | ||
height: 40px; | ||
} | ||
|
||
.nav { | ||
display: flex; | ||
align-items: center; | ||
} | ||
|
||
.nav-list { | ||
margin: 0; | ||
padding: 0; | ||
display: flex; | ||
list-style: none; | ||
} | ||
|
||
.nav-item { | ||
display: flex; | ||
} | ||
|
||
.nav-item + .nav-item { | ||
margin-left: 20px; | ||
} | ||
|
||
.nav-link { | ||
position: relative; | ||
text-decoration: none; | ||
font-weight: 500; | ||
text-transform: uppercase; | ||
text-align: center; | ||
height: var(--header-height); | ||
line-height: var(--header-height); | ||
} | ||
|
||
.nav-link:link { | ||
color: #000; | ||
} | ||
|
||
.nav-link:hover { | ||
color: var(--navhover-color); | ||
} | ||
|
||
.nav-link.is-active { | ||
color: var(--navhover-color); | ||
display: block; | ||
} | ||
|
||
.nav-link.is-active::before { | ||
content: ''; | ||
position: absolute; | ||
left: 0; | ||
bottom: 0; | ||
width: 100%; | ||
height: 4px; | ||
background-color: var(--navhover-color); | ||
border-radius: 8px; | ||
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 |
||
} |
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 the
crossorigin
attribute to thepreconnect
link forfonts.gstatic.com
to improve performance by allowing the browser to make the connection earlier.