https://developer.mozilla.org/ko/docs/Learn/CSS/Styling_text/Typesetting_a_homepage
커뮤니티 대학 홈페이지 레이아웃 구성하기 - Web 개발 학습하기 | MDN
이 평가에서는 커뮤니티 대학 홈페이지의 텍스트 스타일을 지정하도록 하여 이 모듈에서 다룬 모든 텍스트 스타일링 기법에 대한 이해도를 테스트합니다. 여러분은 그 과정에서 재미를 느낄 수
developer.mozilla.org
폴더 구조
폰트는 https://www.fontsquirrel.com/여기서 임의로 두개 다운 받아서 사용했습니다!
index.html
수정 하나도 안했어요! 넘어갈게요!
style.css
차근차근 따라오시면 금방하실 수 있을 거 같아요. 다만 레이아웃이 없다가 이제 처음으로 과제에서 나온 거라 어색할 수는 있어요!
/* General setup */
@font-face {
font-family: "abhaya_librebold";
src: url("fonts/abhayalibre-bold-webfont.woff2") format("woff2"),
url("fonts/abhayalibre-bold-webfont.woff") format("woff");
font-weight: normal;
font-style: normal;
}
@font-face {
font-family: "open_sansregular";
src: url("fonts/opensans-regular-webfont.woff2") format("woff2"),
url("fonts/opensans-regular-webfont.woff") format("woff");
font-weight: normal;
font-style: normal;
}
* {
box-sizing: border-box;
font-size: 10px;
}
html {
font-family: "open_sansregular", sans-serif;
}
body {
margin: 0 auto;
min-width: 1000px;
max-width: 1400px;
}
/* Layout */
section {
float: left;
width: 50%;
}
aside {
float: left;
width: 30%;
}
nav {
float: left;
width: 20%;
}
footer {
clear: both;
}
header,
section,
aside,
nav,
footer {
padding: 20px;
}
/* header and footer */
header,
footer {
border-top: 5px solid #a66;
border-bottom: 5px solid #a66;
}
/* WRITE YOUR CODE BELOW HERE */
h1,
h2,
nav a {
font-family: "abhaya_librebold", sans-serif;
}
header h1 {
text-align: center;
font-size: 3rem;
letter-spacing: 0.2rem;
}
h2 {
font-size: 2rem;
}
section {
line-height: 1.5;
letter-spacing: 0.01rem;
word-spacing: 0.0001rem;
}
p {
font-size: 1.2rem;
color: #59595e;
}
section h2 + p {
text-indent: 20px;
}
a {
font-size: 1.2rem;
outline: none;
}
a:link {
color: #5d5fe4;
}
a:visited {
color: #f06ca9;
}
a:focus {
text-decoration: none;
}
a:hover {
text-decoration: none;
}
a:active {
text-decoration: none;
color: #e8856c;
}
a[href^="http"] {
padding-right: 10px;
background: url(asset/external-link-52.png) no-repeat 100% 50%;
background-size: 8px 8px;
}
ul {
line-height: 1.5;
list-style-type: square;
}
nav ul > li {
display: flex;
justify-content: center;
align-items: center;
font-weight: bold;
padding: 15px;
margin: 10px auto;
list-style-type: none;
border: 2px solid #a66;
}
nav a:link,
a:visited {
text-decoration: none;
color: #a66;
}
nav a {
font-size: 1.5rem;
}
결과
코드가 점점 길어지네요. 서식을 한 번 만들어서 올려 볼게요!
오류 있으면 댓글로 남겨주세요. 감사합니다!
728x90
'Computer > HTML, CSS, Javascript' 카테고리의 다른 글
[CSS] 과제: 미디어 쿼리 (4) | 2024.10.23 |
---|---|
[CSS] 과제: 그리드 레이아웃 (3) | 2024.10.22 |
[CSS] 과제: 멋지게 보이는 박스 (0) | 2024.10.21 |
[CSS] 과제: 멋진 편지지 양식 만들기 (2) | 2024.10.19 |
[CSS] 과제: 기초적인 CSS 이해 (0) | 2024.10.18 |