해결된 질문
작성
·
248
0
<header class="header">
<nav class="header__content">
<div class="header__buttons">
<a href="index.html" class="header__home">
<img src="assets/icons/logo.svg" alt="logo">
</a>
</div>
<div class="header__search">
<img src="assets/icons/search.svg" alt="search">
<input type="text" placeholder="Search...">
</div>
<div class="header__buttons">
<a href="#none">
<img src="assets/icons/home.svg" alt="home">
</a>
<a href="#none">
<img src="assets/icons/shop.svg" alt="shop">
</a>
<a href="#none">
<img src="assets/icons/messenger.svg" alt="messenger">
</a>
<div class="profile__picture">
<img src="assets/images/avatar.png" alt="user picture">
</div>
</div>
</nav>
</header>
.header {
width: 100%;
height: 44px;
background-color: #FFFFFF;
display: flex;
justify-content: center;
position: fixed;
top: 0;
left: 0;
z-index: 2;
border-bottom: 1px solid #DBDBDB;
}
.header__content {
width: 100%;
max-width: 975px;
padding: 0 14px;
display: flex;
justify-content: space-between;
align-items: center;
}
.header__logo {
margin-top: 5px;
}
.header__search {
width: 216px;
height: 28px;
display: none;
align-items: center;
position: relative;
}
@media (min-width: 768px) {
.header__search {
display: flex;
}
}
.header__search img {
width: 12px;
height: 12px;
position: absolute;
top: 8px;
left: 8px;
}
.header__search input {
width: 100%;
height: 100%;
background-color: #FAFAFA;
padding: 4px 10px 4px 28px;
border: 1px solid #DBDBDB;
border-radius: 4px;
outline: none;
font-size: 12px;
/* 폰트 굵기 */
font-weight: 300;
color: #999999;
text-overflow: hidden;
white-space: nowrap;
}
.header__search input:focus {
color: #262626;
}
.header__buttons {
display: flex;
align-items: center;
gap: 16px;
}
.profile__picture img{
width: 24px;
border-radius: 50%;
}
css의 .profile__picture부분에서 저는 강의처럼 말고 뒤에 img를 넣어야지만 사진 크기가 조정되는데 img를 안붙혀도 되는 이유가 궁금합니다!
아! 감사합니다!