기초공사 (html,css,javascript)
js_top버튼이 visible로 바꿔지고 위로 올라감-css 본문
css편
* {
box-sizing: border-box;
-webkit-font-smoothing: antialised;
}
body {
background-color: #313944;
padding: 5em 20em;
}
h1 {
color: #fff;
font-family: 'Cormorant Infant';
font-size: 72px;
font-weight: 700;
line-height: 72px;
letter-spacing: -1px;
margin-bottom: 48px;
text-align: center;
}
h1:after {
color: #1fcfcb;
display: block;
content: '. . .';
font-size: 26px;
line-height: 24px;
height: 24px;
margin: 48px auto;
}
h2 {
color: #fff;
font-family: 'Cormorant Infant';
font-size: 54px;
font-weight: 700;
line-height: 72px;
letter-spacing: -1px;
margin-bottom: 48px;
text-align: center;
}
p {
color: #bbc8d8;
font-family: 'Lato';
font-size: 22px;
font-weight: 500;
line-height: 36px;
margin-bottom: 36px;
text-align: center;
}
a {
color: #1fcfcb;
font-family: 'Lato';
}
a:hover {
color: #fff;
}
#back-to-top {
position: fixed;
bottom: 3em;
right: 3em;
background-color: rgba(255, 255, 255, .9);
color: #313943;
border: none;
border-radius: 5px;
padding: 1em;
text-transform: uppercase;
cursor: pointer;
font-weight: 700;
box-shadow: 0 0 2em 0 rgba(0, 0, 0, .25);
transition: all .3s ease-in-out;
display: inline-block;
opacity: 0;
text-decoration: none;
font-size: .75em;
}
#back-to-top:hover {
background-color: #fff;
padding: 1em 3em;
}
#back-to-top.visible { /*안보이다가 클래스명visible들어오면 보인다.
visible은 어디에있나?css도 없고 자바스크립트를 이용해서 넣어준다는 얘기*/
opacity: 1;
}