본문 바로가기
공부기록/실습

교육원 사이트 만들기 정답

by project100 2023. 2. 28.
@charset "UTF-8";

* {
    margin: 0;
    padding: 0;
}

li {
    list-style: none;
}

header {
    height: 105px;
}

section {
    /* width: 960px; */
    height: 1220px;
    margin: 0 auto;
}

footer {
    height: 205px;
}


div#h_top {
    height: 35px;
    background-color: gray;
    /* margin: 0 auto; */
}

div#h_bottom {
    width: 960px;
    height: 70px;
    margin: 0 auto;
}


div#h_top>div#h_top_wrap {
    /* height: 35px;
    line-height: 35px; */
    width: 960px;
    margin: 0 auto ;
}


div#h_top_wrap>div.h_left {
    float: left;
    /* width: 150px; */
    height: 35px;
    line-height: 35px;
    /* margin-left: 50px; */
    background-color: black;
    color: white;
}

div#h_top_wrap>nav.t_nav {
    float: right;
    /* height: 35px;
    line-height: 35px; */
}


div#h_top_wrap>nav.t_nav>ul>li {
    float: left;
    line-height: 35px;
    margin: 0 20px;
}

div#h_bottom>h1 {
    float: left;
    /* height: 70px;
    line-height: 70px; */
    margin-right: 90px;
    margin-top: 10px;
}

div#h_bottom>nav.m_nav {
    /* width: 960px; */
    float: left;
    margin-top: 20px;
}

div#h_bottom>nav.m_nav>ul>li {
    float: left;
    /* height: 70px;
    line-height: 70px;
    text-align: center;
    margin: 0 25px; */
    margin-right: 50px;
}

section>div {
    width: 960px;
    /* margin-bottom: 10px; */
    margin: 0 auto;
    margin-top: 10px;
}
section>div#s_box1 {
    height: 355px;
}
section>div#s_box2 {
    height: 160px;
}
section>div#s_box3 {
    height: 125px;
}
section>div#s_box4 {
    height: 65px;
}
section>div#s_box5 {
    height: 240px;
}
section>div#s_box6 {
    height: 155px;
    margin-bottom: 60px;
}

div#s_box1>div {
    float: left;
}

div#s_box1>div:nth-child(1) {
    /* float: left; */
    width: 650px;
    height: 355px;
    background-color: orange;
}

div#s_box1>div:nth-child(2) {
    /* float: left; */
    width: 310px;
    height: 355px;
    background-color: pink;
}

div#s_box2>div {
    width: 310px;
    float: left;
    height: 160px;
    margin-right: 15px;
}
div#s_box2>div:nth-child(1) {
    background-color: rgb(214, 161, 161);
}
div#s_box2>div:nth-child(2) {
    background-color: rgb(179, 226, 179);
}
div#s_box2>div:nth-child(3) {
    background-color: rgb(119, 119, 241);
    margin-right: 0;
}

div#s_box3, div#s_box4 {
    border: 1px solid grey;
    box-sizing: border-box;
}

div#s_box5>div {
    width: 475px;
    float: left;
    height: 240px;
    border: 1px solid gray;
    box-sizing: border-box;
    margin-right: 10px;
}
div#s_box5>div:nth-child(1) {
    background-color: rgb(236, 163, 95);
}
div#s_box5>div:nth-child(2) {
    background-color: rgb(197, 138, 252);
    margin-right: 0;
}

div#s_box6>div {
    float: left;
    width: 232.5px;
    height: 155px;
    border: 1px solid gainsboro;
    margin-right: 10px;
    box-sizing: border-box;
}

/* div#s_box6>div:nth-child(1) {
    width: 232.5px;
    float: left;
    height: 155px;
    border: 1px solid black;
    box-sizing: border-box;
    margin-right: 10px;
}
div#s_box6>div:nth-child(2) {
    width: 232.5px;
    float: left;
    height: 155px;
    border: 1px solid black;
    box-sizing: border-box;
    margin-right: 10px;
}
div#s_box6>div:nth-child(3) {
    width: 232.5px;
    float: left;
    height: 155px;
    border: 1px solid black;
    box-sizing: border-box;
    margin-right: 10px;
} */

div#s_box6>div>ul>li {
    /* float: left;
    width: 232.5px; */
    height: 72.5px;
    border: 1px solid black;
    box-sizing: border-box;
    margin-bottom: 10px;
}

div#s_box6>div:last-child {
    margin-right: 0;   
}

div#f_top {
    height: 60px;
    background-color: aliceblue;
}

div#f_bottom {
    height: 145px;
    background-color: grey;
}

div#f_top>div#f_top_wrap {
    width: 960px;
    margin: 0 auto;
}

div#f_top_wrap>nav.f_nav {
    float: left;
}

div#f_top_wrap>nav.f_nav>ul>li {
    float: left;
    height: 60px;
    line-height: 60px;
    margin: 0 5px;
}

div#f_top>div#f_top_wrap>div.f_site {
    float: right;
    height: 60px;
    line-height: 60px;
}

/* div#f_bottom {
    margin: 0 auto;
    padding-top: 30px;
    box-sizing: border-box;
} */

div#f_bottom>div#f_bottom_wrap {
    /* float: left; */
    width: 960px;
    margin: 0 auto;
    padding-top: 30px;
}

div#f_bottom>div#f_bottom_wrap>h1 {
    float: left;
    margin-right: 80px;
    /* padding-left: 30px; */
}

/* div#f_bottom>div#f_bottom_wrap>address {
    width: 150px;
    float: left;
} */

주석 부분은 내가 쓴 부분이다.

불필요하게 많이 작성된 부분을 빼고도 그림과 똑같이 만들 수 있기 때문에 불필요한 코드를 작성하지 않도록

코드를 분석하고 작성하는 연습을 많이 해야 겠다.