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

Develop #4535

Closed
wants to merge 4 commits into from
Closed

Develop #4535

Show file tree
Hide file tree
Changes from 3 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://MykolaDotsenko.github.io/layout_moyo-header/)
- [TEST REPORT LINK](https://MykolaDotsenko.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)
50 changes: 49 additions & 1 deletion src/index.html
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@

<!doctype html>
<html lang="en">
<head>
Expand All @@ -6,9 +7,56 @@
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">
<title>Moyo header</title>
<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:wght@400;500;700&display=swap" rel="stylesheet">
<link rel="stylesheet" href="./style.css">
</head>
<body>
<h1>Moyo header</h1>
<header class="header">
<a
class="header__logo"
href="#"
aria-label="Home"
>
<img src="./images/logo.png" alt="logo">

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
<img src="./images/logo.png" alt="logo">
<img class="header__img" src="./images/logo.png" alt="logo">

</a>
<nav class="header__nav">
<ul class="header__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>
74 changes: 74 additions & 0 deletions src/style.css
Original file line number Diff line number Diff line change
@@ -1,3 +1,77 @@
:root {
--main-color: #00acdc;
}

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

.header {
display: flex;
justify-content: space-between;
align-items: center;
color: #000;
position: relative;
padding: 0 50px;
}

.header__logo img {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

still not fixed

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

напиши як

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ви тут навчаэте чи допити влаштовуєте????

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

image

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
.header__logo img {
.header__img {

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

а в чому помилка коли на тег а стояв клас?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

я не міг зрозуміти що потрібно якщо клас від а впринципі керував картинкою

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Завжди краще робити саме таким чином

Комбіновані селектори уже мають вищу специфічність, це надійніше і зручніше потім підтримувати якщо селектор це просто 1 класс :)

height: 100%;
width: 100%;
}

.header__logo {
display: block;
width: 40px;
height: 40px;
}

.header__list {
list-style: none;
margin: 0;
padding: 0;
display: flex;
}

.nav__item {
margin-left: 20px;
text-decoration: none;
}

.nav__item:first-child {
margin-left: 0;
}

.nav__link.is-active {
color: var(--main-color);
}

.nav__link {
position: relative;
display: flex;
align-items: center;
height: 60px;
font-family: Roboto, sans-serif;
font-size: 12px;
font-weight: 500;
white-space: nowrap;
text-decoration: none;
text-transform: uppercase;
color: #000;
}

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

.is-active::after {
content: "";
position: absolute;
bottom: 0;
left: 0;
right: 0;
height: 4px;
border-radius: 2px;
background-color: var(--main-color);
}
Loading