HTML
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>St Huxley's Community College</title>
<link rel="stylesheet" type="text/css" href="style.css">
</head>
<body>
<header>
<h1>St Huxley's Community College</h1>
</header>
<section>
<h2>Brave new world</h2>
<p>
It's a brave new world out there. Our children are being put in increasing more competitive situations, both
during recreation, and as they start to move into the adult world of <a
href="https://en.wikipedia.org/wiki/Examination">examinations</a>, <a
href="https://en.wikipedia.org/wiki/Jobs">jobs</a>, <a
href="https://en.wikipedia.org/wiki/Career">careers</a>, and other life choices. Having the wrong mindset,
becoming <a href="https://en.wikipedia.org/wiki/Emotion">too emotional</a>, or making the wrong choices can
contribute to them experiencing difficulty in taking their rightful place in today's ideal society.
</p>
<p>
As concerned parents, guardians or carers, you will no doubt want to give your children the best possible start
in life — and you've come to the right place.
</p>
<h2>The best start in life</h2>
<p>
At St. Huxley's, we pride ourselves in not only giving our students a top quality education, but also giving them
the societal and emotional intelligence they need to win big in the coming utopia. We not only excel at subjects
such as genetics, data mining, and chemistry, but we also include compulsory lessons in:
</p>
<ul>
<li>Emotional control</li>
<li>Judgement</li>
<li>Assertion</li>
<li>Focus and resolve</li>
</ul>
<p>
If you are interested, then you next steps will likely be to:
</p>
<ol>
<li><a href="#">Call us</a> for more information</li>
<li><a href="#">Ask for a brochure</a>, which includes signup form</li>
<li><a href="#">Book a visit</a>!</li>
</ol>
</section>
<aside>
<h2>Top course choices</h2>
<ul>
<li><a href="#">Genetic engineering</a></li>
<li><a href="#">Genetic mutation</a></li>
<li><a href="#">Organic Chemistry</a></li>
<li><a href="#">Pharmaceuticals</a></li>
<li><a href="#">Biochemistry with behaviour</a></li>
<li><a href="#">Pure biochemistry</a></li>
<li><a href="#">Data mining</a></li>
<li><a href="#">Computer security</a></li>
<li><a href="#">Bioinformatics</a></li>
<li><a href="#">Cybernetics</a></li>
</ul>
<p>
<a href="#">See more</a>
</p>
</aside>
<nav>
<ul>
<li><a href="#">Home</a></li>
<li><a href="#">Finding us</a></li>
<li><a href="#">Courses</a></li>
<li><a href="#">Staff</a></li>
<li><a href="#">Media</a></li>
<li><a href="#">Prospectus</a></li>
</ul>
</nav>
<footer>
<p>
© 2016 St Huxley's Community College
</p>
</footer>
</body>
</html>
CSS - text-decorataion: none; 속성
/* General setup */
* {
box-sizing: border-box;
}
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 */
/*! Generated by Font Squirrel (https://www.fontsquirrel.com) on November 12, 2022 */
@font-face {
font-family: 'afta_serifregular';
src: url('fonts/aftaserifthin-regular-webfont.woff2') format('woff2'),
url('fonts/aftaserifthin-regular-webfont.woff') format('woff');
font-weight: normal;
font-style: normal;
}
@font-face {
font-family: 'bree_serifregular';
src: url('fonts/breeserif-regular-webfont.woff2') format('woff2'),
url('fonts/breeserif-regular-webfont.woff') format('woff');
font-weight: normal;
font-style: normal;
}
/* typography stuff */
html {
font-family: 'afta_serifregular', sans-serif;
font-size: 10px;
}
h1,
h2 {
font-family: 'bree_serifregular', sans-serif;
letter-spacing: 5px;
}
h1 {
font-size: 5rem;
text-align: center;
}
h2 {
font-size: 3.2rem;
}
section h2 + p {
text-indent: 20px;
}
p,
li {
font-size: 1.6rem;
line-height: 1.6;
letter-spacing: 0.5px;
word-spacing: 3px;
}
/* Link styling */
a {
outline: none;
}
a[href^="https"] {
padding-right: 18px;
background: url(external-link-52.png) no-repeat 100% 0;
background-size: 16px 16px;
}
a:link,
a:visited {
color: #AB6866;
}
a:focus,
a:hover {
text-decoration: none;
}
a:active {
color: transparent;
text-shadow: 0px 0px 1px #f00,
0px 0px 2px #f00,
0px 0px 3px black,
0px 0px 4px black;
}
/* lists: extra margin top and bottom to make it
always have the same spacing as with paragraphs */
ul, ol {
margin: 16px 0;
}
ul {
list-style-type: square;
}
ol {
list-style-type: lower-latin;
}
/* nav menu */
nav ul {
padding-left: 0;
margin-top: 10px;
}
nav li {
list-style-type: none;
margin-bottom: 20px;
}
nav li a {
text-decoration: none;
display: inline-block;
width: 100%;
line-height: 3;
text-align: center;
font-size: 2.5rem;
border: 1px solid #a66;
}
nav li a:focus,
nav li a:hover {
color: white;
background-color: #a66;
}
nav li a:active {
color: yellow;
background-color: black;
}
CSS - border-bottom 속성으로 밑줄 만들기
/* General setup */
* {
box-sizing: border-box;
}
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 */
/*! Generated by Font Squirrel (https://www.fontsquirrel.com) on November 12, 2022 */
@font-face {
font-family: 'afta_serifregular';
src: url('fonts/aftaserifthin-regular-webfont.woff2') format('woff2'),
url('fonts/aftaserifthin-regular-webfont.woff') format('woff');
font-weight: normal;
font-style: normal;
}
@font-face {
font-family: 'bree_serifregular';
src: url('fonts/breeserif-regular-webfont.woff2') format('woff2'),
url('fonts/breeserif-regular-webfont.woff') format('woff');
font-weight: normal;
font-style: normal;
}
/* typography stuff */
html {
font-family: 'afta_serifregular', sans-serif;
font-size: 10px;
}
h1,
h2 {
font-family: 'bree_serifregular', sans-serif;
letter-spacing: 5px;
}
h1 {
font-size: 5rem;
text-align: center;
}
h2 {
font-size: 3.2rem;
}
section h2 + p {
text-indent: 20px;
}
p,
li {
font-size: 1.6rem;
line-height: 1.6;
letter-spacing: 0.5px;
word-spacing: 3px;
}
/* Link styling */
a {
outline: none;
text-decoration: none;
}
a[href^="https"] {
padding-right: 18px;
background: url(external-link-52.png) no-repeat 100% 0;
background-size: 16px 16px;
}
a:link,
a:visited {
color: #AB6866;
border-bottom: 1px solid;
}
a:focus,
a:hover {
border-bottom: none;
}
a:active {
color: transparent;
text-shadow: 0px 0px 1px #f00,
0px 0px 2px #f00,
0px 0px 3px black,
0px 0px 4px black;
}
/* lists: extra margin top and bottom to make it
always have the same spacing as with paragraphs */
ul,
ol {
margin: 16px 0;
}
ul {
list-style-type: square;
}
ol {
list-style-type: lower-latin;
}
/* nav menu */
nav ul {
padding-left: 0;
margin-top: 10px;
}
nav li {
list-style-type: none;
margin-bottom: 20px;
}
nav li a {
display: inline-block;
width: 100%;
line-height: 3;
text-align: center;
font-size: 2.5rem;
}
nav li a:link,
nav li a:visited,
nav li a:focus,
nav li a:hover {
border: 1px solid #a66;
}
nav li a:focus,
nav li a:hover {
color: white;
background-color: #a66;
}
nav li a:active {
color: yellow;
background-color: black;
border: 1px solid black;
}
도움 받은 곳
https://github.com/mdn/learning-area/blob/main/css/styling-text/typesetting-a-homepage-finished/style.css
https://discourse.mozilla.org/t/typesetting-a-community-school-home-page-assessment/24683/2
https://developer.mozilla.org/en-US/docs/Learn/CSS/Styling_text/Styling_links
https://developer.mozilla.org/en-US/docs/Web/CSS/list-style-type
깨달은 것
1. 밑줄은 border-bottom가 아니라 text-decoration 을사용하여 만들어졌습니다. 일부 사람들은 전자가 후자보다 더 나은 스타일 옵션을 가지고 있기 때문에 이것을 선호합니다. 또한 밑줄이 그어진 단어의 디센더를 가로지르지 않도록 약간 더 낮게 그려집니다. (MDN)
2. border-bottom 속성으로 밑줄을 만들어보려고 시도했는데 코드의 가독성을 보면 text-decoration: none;을 쓰는게 더 좋아보인다. 하지만 단어를 가로지르지 않기에 border-bottom을 쓰는 것에 익숙해져야겠다.
찾아볼 것
CSS 2번째 코드를 더 쉽게 작성하는 법이 뭘까?