훈련 - (4) Logo in Header
Logo in Header
😎 html
html 코드
<h1>
<a href="./LogoInHeader.html"><img src="https://statics.goorm.io/logo/edu/goorm_edu.svg" alt="Goorm Edu" /></a>
</h1>
<a href="https://edu.goorm.io/qna">Q&A</a>
결과 화면
<h1>
<a href="./LogoInHeader.html"><img src="https://statics.goorm.io/logo/edu/goorm_edu.svg" alt="Goorm Edu" /></a>
</h1>
<a href="https://edu.goorm.io/qna">Q&A</a>
😎 css
css를 입힌 코드
LogoInHeader.html
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Logo in Header</title>
</head>
<body>
<div class="header">
<h1>
<a href="./LogoInHeader.html"><img src="https://statics.goorm.io/logo/edu/goorm_edu.svg" alt="Goorm Edu" /></a>
</h1>
<a href="https://edu.goorm.io/qna">Q&A</a>
</div>
</body>
</html>
styles.css
@import url('https://fonts.googleapis.com/css?family=Noto+Sans+KR&display=swap');
* {
margin: 0;
box-sizing: border-box;
}
html {
font-family: 'Noto Sans KR', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial,
sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji', 'Segoe UI Symbol';
font-size: 16px;
line-height: 1.5;
color: #1f2d3d;
}
body {
display: flex;
flex-direction: column;
justify-content: center;
align-items: center;
width: 100%;
height: 100vh;
margin: 0 auto;
background-color: #1f2d3d;
}
body::after {
content: 'frenchkebab©';
display: block;
margin-top: 50px;
color: #fff;
font-size: 12px;
font-weight: 600;
}
.header {
display: flex;
justify-content: space-between;
align-items: center;
width: 90%;
padding: 12px 56px;
border-radius: 3px;
background-color: #fff;
box-shadow: 0 0 3px 0 rgba(0, 0, 0, 0.1);
}
.header h1 {
position: relative;
top: 1px;
}
.header h1 img {
display: block;
width: auto;
height: 30px;
}
.header a {
display: block;
text-decoration: none;
font-size: 0.875rem;
color: #313338;
}
.header a:hover {
opacity: 0.5;
}
.header a:visited {
color: inherit;
}
결과 화면
😎 알아갈 점
이미지 자체에 텍스트가 들어있을 때?
다시 text를 넣어서 css로 가려주기 보다는, 그냥 alt값으로 해당 text를 넣어주면 된다!
Author And Source
이 문제에 관하여(훈련 - (4) Logo in Header), 우리는 이곳에서 더 많은 자료를 발견하고 링크를 클릭하여 보았다 https://velog.io/@frenchkebab/html-훈련-4-Logo-in-Header저자 귀속: 원작자 정보가 원작자 URL에 포함되어 있으며 저작권은 원작자 소유입니다.
우수한 개발자 콘텐츠 발견에 전념 (Collection and Share based on the CC Protocol.)