Skip to content
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 #5379

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 9 additions & 9 deletions readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,15 +27,15 @@ The page should match the design Pixel Perfect: all the sizes, colors and distan

❗️ Replace `<your_account>` with your Github username and copy the links to `Pull Request` description:

- [DEMO LINK](https://<your_account>.github.io/layout_moyo-header/)
- [TEST REPORT LINK](https://<your_account>.github.io/layout_moyo-header/report/html_report/)
- [DEMO LINK](https://cassiaqueiroz.github.io/layout_moyo-header/)
- [TEST REPORT LINK](https://cassiaqueiroz.github.io/layout_moyo-header/report/html_report/)

❗️ Copy this `Checklist` to the `Pull Request` description after links, and put `- [x]` before each point after you checked it.

- [ ] Header height is set in 1 place (for the links)
- [ ] Content is vertically centered (for any header height)
- [ ] CSS is used to show all letters in Uppercase (don't type them in HTML)
- [ ] Logo is an image wrapped with a link
- [ ] **CSS Variable** is used for a blue color
- [ ] Pseudo-element is used for a blue line below the active link
- [ ] Code follows all the [Code Style Rules ❗️](./checklist.md)
- [x] Header height is set in 1 place (for the links)
- [x] Content is vertically centered (for any header height)
- [x] CSS is used to show all letters in Uppercase (don't type them in HTML)
- [x] Logo is an image wrapped with a link
- [x] **CSS Variable** is used for a blue color
- [x] Pseudo-element is used for a blue line below the active link
- [x] Code follows all the [Code Style Rules ❗️](./checklist.md)
104 changes: 101 additions & 3 deletions src/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,19 +4,117 @@
<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"
content="width=device-width, initial-scale=1.0"
/>
<meta
http-equiv="X-UA-Compatible"
content="ie=edge"
/>
<title>Moyo header</title>
<title>Moyo Header</title>
<link
rel="stylesheet"
href="./style.css"
/>

<!-- Import the Roboto font -->
<link
rel="preconnect"
href="https://fonts.googleapis.com"
/>
<link
rel="preconnect"
href="https://fonts.gstatic.com"
crossorigin="anonymous"
/>
<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">
<!-- Logo -->
<a
href="index.html"
class="header__logo"
>
<img
src="./images/logo.png"
alt="Moyo Logo"
/>
</a>

<!-- Navigation Menu -->
<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">
<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>
</header>
</body>
</html>
71 changes: 71 additions & 0 deletions src/style.css
Original file line number Diff line number Diff line change
@@ -1,3 +1,74 @@
:root {
--logo-width: 40px;
--logo-height: 40px;
--nav-height: 60px;
--blue-color: #00acdc;
}

body {
margin: 0;
padding: 0;
font-family: Roboto, sans-serif;
}

.header {
width: 100%;
display: flex;
justify-content: space-between;
align-items: center;
box-sizing: border-box;
padding: 0 50px;
}

.header__logo {
width: var(--logo-width);
height: var(--logo-height);
}

.nav__list {
list-style: none;
padding: 0;
margin: 0;
display: flex;
align-items: center;
}

.nav__item {
margin: 0;
padding: 0;
}

.nav__item:not(:last-child) {
margin-right: 20px;
}

.nav__link {
display: flex;
align-items: center;
text-decoration: none;
text-transform: uppercase;
font-size: 12px;
color: black;
height: var(--nav-height);
line-height: var(--nav-height);
font-weight: 500;
}

.nav__link:hover {
color: var(--blue-color);
}

.nav__link.is-active {
color: var(--blue-color);
position: relative;
}

.nav__link.is-active::after {
content: '';
position: absolute;
bottom: 0;
width: 37px;
height: 4px;
background-color: var(--blue-color);
border-radius: 8px;
}
Loading