728x90
728x90

블로그 작성을 중단한지 엄청 오래 된거 같다. 

직장 생활도 하고 개인적인 시간도 보내고, 공부도 하고 많은 일들이 있었다.

그러다가 문득 블로그를 다시 써봐야한다는 생각이 들었고, 그런김에 포트폴리오 사이트를 리뉴얼하는 제작기를 시작으로 차근차근 하나씩 작성해 보고자 한다.

 

포트폴리오는 React를 통해서 Github Page를 이용해 배포를 하고, 포트폴리오에 들어갈 프로젝트나 시연 Demo를 위한 초간단 서버를 네이버 클라우드를 통해서 배포해보고자 한다.

퀄리티는 어떨지 모르겠지만, 차근히 하나씩 다시 해봐야지 

 

728x90
728x90

  Main 컨텐츠  

- 이번 포스팅에서는 index 페이지에 있는 텍스트와 이미지 컨텐츠들을 수정하여 반응형 웹에 적용되도록 해보겠습니다.

 

  Index 페이지 태그 추가   

- index 페이지에 있는 컨텐츠들을 감싸주는 index 클래스 태그를 추가 시켜 줍니다.

<div id='index' class="move">

    <div id='maintext'>Welcome to My PortFolio</div>
    <div id="mainsubtext">
        <p>Breath</p>
        <p>- Everything will be made by me.</p>
    </div>
    <div id='mainimg'>
        <img src="../static/img/main/main_img.jpg" alt="MainImage">
    </div>
</div>

  Index 페이지 - CSS 수정  

- 기존에 있는 index 페이지의 css를 수정해 주겠습니다.

#main {
    float: left;
    width: 100%;
    position: relative;
}

 

#index {
    height: calc(100vh - 100px);
    float: left;
    position: relative;
    width: 80vw;
    left: 20vw;
}

#index {
    height: calc(100vh - 100px);
    float: left;
    position: relative;
    width: 80vw;
    left: 20vw;
}

#maintext {
    position: absolute;
    top: 50%;
    left: 10vw;
    transform: translate(0, -50%);
    font-size: 8vw;
    color: #f41f56;
    font-weight: 700;
    z-index: 2;
}

#mainsubtext {
    position: absolute;
    top: calc(50% + 13vw);
    left: calc(10vw);
    transform: translate(0, -50%);
    z-index: 2;
}

#mainsubtext > p:nth-child(1) {
    font-size: 3vw;
}

#mainsubtext > p:nth-child(2) {
    font-size: 1.5vw;
    margin-top: 1vw;
}

#mainimg {
    position: absolute;
    float: left;
    top: 50vh;
    left: 60vw;
    transform: translate(-50%, -50%);
    width: 45vw;
    z-index: 1;
}

#mainimg > img {
    max-width: 100%;
}

 

 

 

 

 

 

 

 

 

- 잘 적용 되었습니다.!!!

- 다음 포스팅에서는 about 페이지를 수정해 보겠습니다.

 

728x90
728x90

  반응형 웹  (Responsive Web)  

- 반응형 웹은 디바이스의 종류에 따라 웹페이지의 크기가 자동으로 변경되는 것을 말합니다.

- 지금 제작하고 있는 포트폴리오 웹사이트의 경우 크기가 고정되어 있어, 모바일이나 태블릿 환경에서는 웹페이지가 잘리게 됩니다.

 

- 기존의 css코드를 %, vw, vh 등을 사용해서 media query (미디어 쿼리)를 사용해서 반응형으로 수정해 보겠습니다.

- 아래의 단계에 따라 진행해 보겠습니다.

 

  단계  

1. media.css 링크 / 태그 추가

2. 전체 페이지 크기 수정

3. 사이드 바 수정

4.사이드바 - 미디어 쿼리  

5.사이드바 - jQeury

6.사이드바 - css 수정

  1. media.css 링크  

- 미디어 쿼리를 사용하는 법은 간단합니다.

@media (max-width:1440px) {
 	/* css 코드 */
}

- 각 디바이스의 크기와 미디어 쿼리의 분기점은 구글에 media queries breakpoint 로 검색하면 알 수 있습니다.

- 제가 사용할 분기점들의 목록은 아래의 링크를 참고 하여 가져왔습니다.

 

devfacts.com/media-queries-breakpoints-2020/

 

Media Queries Breakpoints For Responsive Design In 2020 - DevFacts

Learn how to write Media Queries Breakpoints for your web applications.Here you can find standared media qurie breakpoints in 2020.

devfacts.com

- css 파일에 위 코드를 추가해 주면 됩니다.

- 기존의 css파일에 추가해 줘도 되지만, media.css파일을 만들어 추가 해 주겠습니다.

- layout.html 에 <link>를 사용해 추가 해 주겠습니다.

- 모바일 환경에도 잘 적용 시키기 위해 <head>에 <meta<meta name="viewport"> 를 추가해주겠습니다.

<meta name="viewport" content="width=device-width, initial-scale=1.0">

- 반응형 웹을 만들때는 모바일 기기에 맞춰 시작해 PC환경으로 크기를 맞추는 방법과 이 방법을 역으로 진행할 수 있습니다.

- 저는 PC환경에서 웹 페이지를 만든 후 max-width를 사용해 모바일 기기로 점점 페이지의 크기를 줄이는 방법을 이용해 보겠습니다.

 

  2. 전체 페이지 크기 수정  

- 우선 기존의 페이지를 수정해 보겠습니다.

 

- 웹페이지의 컨텐츠들이 들어가는 main에 border크기를 지정해 현재 페이지가 어떻게 되어있는지 확인해 보겠습니다.

 

#main {
    margin: 0 auto;
    position: relative;
    width: 1440px;
    border:2px solid red;
}

- main이 박스 형태가 아닙니다. 높이 값이 지정되어 있지 않아 height가 0이라서 그렇습니다.

- main을 가운데 정렬 시켜 주기위해 margin :0 auto를 사용했습니다.

- 이제 main의 margin값을 삭제하고, 가로크기를 브라우저의 크기에 맞춰 주기 위해 100%를 설정한뒤 왼쪽으로 정렬 시켜 주겠습니다.

 

 

#main {
    float: left;
    position: relative;
    width: 100%;
}

 

- main 크기가 변경 되면서 안에 있는 컨텐츠 들이 위치가 변경 되었습니다.

- 이제 하나씩 수정을 해 보겠습니다.

 

  3. 사이드 바 수정  

 

- 먼저 각 페이지에 공통 적으로 들어가는 사이드 바을 수정해 주겠습니다.

#sidebar {
    float: left;
    width: 200px;
    margin-top: 150px;
}

- magin 값을 삭제 처리 합니다.

- 다른 컨텐츠들은 차후에 진행하므로 우선은 사이드바에 초점을 맞춰 진행해 보겠습니다.

- 사이드 바의 크기는 고정되어 있기때문에 브라우저의 크기가 줄어들어도 크기나 위치가 변하지 않습니다.

- 미디어 쿼리 분기점을 통해서 브라우저의 크기가 줄어들게 되면 사이드바의 디자인이 변경되게 해줍니다.

- 크기가 1024px 미만이 되면 사이드바가 왼쪽으로 사라지고 메뉴 탭이 생기도록 하겠습니다.

 

  4.사이드바 - 미디어 쿼리  

- 미디어 쿼리를 만들기 전에 태그 추가와 css수정을 해줘야합니다.

- layout.html에 nav태그 밑에 div.menu 태그를 추가 해 줍니다.

<div class="menu">
	<span>
		Menu
	</span>
</div>

- #sidebar의 width와 height를 삭제해주고 display : flex를 추가합니다.

- display flex를 추가하면 부모의 높이가 자식들에 의해 지정되면 높이가 지정되지 않은 자식들의 높이는 부모의 높이에 자동으로 지정되게 됩니다.

#sidebar {
    position: absolute;
    float: left;
    display: flex;
}

- 이제 .menu와 .menu>span스타일을 아래의 코드처럼 지정해 주겠습니다.

 

.menu {
    float: left;
    width: 30px;
    height: inherit;
    background-color: lightgray;
}

.menu > span{
    display: inline-block;
    position: relative;
    top: 50%;
    left: 50%;
    transform: translate(-50%,-50%) rotate(270deg);
    
}

 

 

- Menu 부분이 새로 생겼네요.

- 이제 브라우저의 크기가 변경되면 Menu가 생기고 사라지게 해주겠습니다.

- 우선은 .menu에 display:none;을 추가해 줍니다.

.menu {
    float: left;
    width: 30px;
    height: inherit;
    background-color: lightgray;
    display: none;
}

- media.css에 max-width:1023.99px 인 분기점을 만들어 줍니다.

 

@media (max-width:1023px) {
    
}

- 중가로 안에 css 코드를 작성해 주면 됩니다.

- 선택자로 .menu 선택한 후 display:block을 추가합니다.

@media (max-width:1023px) {
    
    .menu{
        display: block;
    }
}

 

- 가로의 크기에 따라 변하는 것을 볼 수 있습니다.

- 이제 크기가 줄어 들면 사이드바의 nav부분이 왼쪽으로 사라지게 만들어 줍니다.

- 미디어 쿼리 #sidebar에 아래의 코드를 추가해 줍니다.

 

@media (max-width:1023px) {
    #sidebar{
        left: -200px;
    }
    .menu{
        display: block;
    }
}

 

- 이제 .menu 를 클릭하면 사이드 바가 나오게 만들어 주기위해 js파일에 코드를 추가해 주겠습니다.

 

  5. 사이드바 - jQuery  

- common.js에 click을 이용해 Menu클릭시 사이드바가 나타나겠끔 해줍니다.

$('.menu').click(function(){
        
       $('#sidebar').css({
           'left':'0'
       }) 
        
        
    });

- .menu 클릭시 #sidebar 의 left값을 0으로 만들어 주면 sidebar의 위치가 바뀌면서 나타나게 됩니다.

- 다시 .menu 클릭시 사라져야 합니다.

- 위 기능을 추가하기 위해 .menu의 class 에 show를 추가 해 줍니다.

- 그리고 jQuery 코드를 아래와 같이 수정해 줍니다.

$(document).on("click",".show",function () {
        $('#sidebar').css({
            'transition':'0.8s',
            'left': '0'
        });
        $('.menu').removeClass('show');
        $('.menu').addClass('hide');
        $('.menu').empty();
        $('.menu').append('<span>Close<span>');

    });
    
    $(document).on("click",".hide",function () {
        $('#sidebar').css({
            'transition':'0.8s',
            'left': '-200px'
        });
        $('.menu').removeClass('hide');
        $('.menu').addClass('show');
        $('.menu').empty();
        $('.menu').append('<span>Menu<span>');

    });

- 동적으로 생성된 선택자를 클릭하면 작동이 안할 경우가 있습니다.

- 이때 .click 이 아닌 $(document).on("click",선택자,function(){})을 사용하면 해결됩니다.

- show를 클릭하면 사이드바가 나타나고, show class를 삭제 hide를 추가하고 Menu 텍스트를 Close로 바꿔 줍니다.

- 사이드바를 닫을때는 반대로 작동합니다.

 

  6. 사이드바 - css 수정  

- 사이드 바의 Menu / Close 부분이 썩 마음에 들지 않습니다.

- css를 수정해 스타일을 바꿔주겠습니다.

- Menu / Close 텍스트 클릭시 nav사 나타나게 하기 위해서 .menu 에 추가해줬던 show hide를 span으로 옯겨 주기위해서 코드들을 아래와 같이 수정합니다.

 

- layout.html

            <div class="menu">
                <span class="show">
                    Menu
                </span>
            </div>

- common.js

$(document).on("click", ".show", function () {
        $('#sidebar').css({
            'left': '0'
        });
        $('.move').css({
            'left': '30vw'
        });
        $('.menu').empty();
        $('.menu').append('<span class="hide">Close<span>');

    });

    $(document).on("click", ".hide", function () {

        $('#sidebar').css({
            'left': '-200px'
        });
        $('.move').css({
            'left': '18vw'
        });
        $('.menu').empty();
        $('.menu').append('<span class="show">Menu<span>');

    });

    $(window).resize(function () {
        var width = $(window).width();
        if (width >= 1024) {
            $('#sidebar').css({
                'left': '0'
            });
            $('.menu').css({
               'display':'none'
            });
        } else {
            $('#sidebar').css({
                'left': '-200px'
                
            });
            $('.menu').css({
               'display':'block' 
            });
        }
    });

 

- style.css

#sidebar {
    float: left;
    display: flex;
    position: fixed;
    top: 50vh;
    transform: translate(0, -50%);
    z-index: 10;
}

nav {
    float: left;
    width: 200px;
    transition: 0.4s linear;
}

.menu {
    float: left;
    width: 3vw;
    height: inherit;
    display: none;
}

.menu > span {
    display: inline-block;
    position: relative;
    top: 50%;
    left: 50%;
    color: white;
    background-color: black;
    text-align: center;
    width: 12vw;
    height: 4vw;
    font-size: 2vw;
    line-height: 4vw;
    letter-spacing: 0.3vw;
    transform: translate(-50%, -50%) rotate(270deg);
    cursor: pointer;
}

 

- 사이드바의 스타일과 기능을 추가 해줬습니다.

- 다음 포스팅에서는 index 페이지에 있는 이미지와 텍스트 content를 수정해 주겠습니다.

728x90
728x90

  Footer  

- Footer부분은 웹사이트의 가장 하단에 위치하고 있습니다.

- 웹사이트의 중요하고 우선순위가 높은 컨텐츠들은 보통 상단이나 사이드에 위치해 있습니다.

- 그만큼 Footer부분은 작은 폰트사이즈로 링크만 제공되어 왔습니다.

- 하지만 이제는 웹사이트의 디자인이나 레이아웃에 맞게 끔 footer에도 많은 정보가 담기기도 하고, 기능이 변화하고 있습니다.

- 또 하지만, 제가 원하는 디장인에서 Footer부분은 아주 작은 영역에 불과 하기 때문에 그리 중요하지는 않습니다.

- 아주 간단한 텍스트만 추가 하면 됩니다.

 

  텍스트 추가 및 크기/ 위치 지정  

- footer에 들어갈 컨텐츠들이 많다면 footer페이지를 따로 분리하면 좋겠지만, 텍스트만 들어가므로 layout.html 페이지에서 바로 진행합니다.

- footer태그 안에 ©2020 Hiio.  All rights Reserved. 라는 텍스트를 span에 감싸서 추가해 줍니다.

    <footer>
        <span>
            ©2020 Hiio.  All rights Reserved.
        </span>
    </footer>

 

- footer 의 스타일을 지정해 주겠습니다.

- text-align center / line-heght 50px 지정해 줍니다.

- 그리고 thin10선택자를 만들어 font-size 10px / font-weight 100으로 지정해준후 footer 안의 span class를 thin10으로 지정해 줍니다.

 

 

 

  문제 와 해결  

- 사실 위 과정 되로 진행 하게 되면 문제가 발생합니다.

- main 안에 있는 컨텐츠들의 높이가 반영되지 않아 main 높이값으로 지정해 준 height 100%만 반영되고, 그 밑에 footer가 오게 되어 height 100%를 넘어가는 높이는 footer에 겹쳐서 보여지게 됩니다.

- 이를 해결하기 위해 #about 태그를 추가해 about 컨텐츠들을 감싸줍니다.

- #about / #portfolio / #sidebar / #contact 의 값들을 아래의 코드처럼 수정해 줍니다.

- 이 후 각 컨텐츠들에게 지정해준 left / top 값을 수정하고 float left 와 margin 값을 통해서 위치를 조정해 줍니다.

- 아래의 코드는 위의 내용을 반영한 코드입니다.

 

html,
body {
    font-family: 'Noto Sans KR', sans-serif;
    height: 100%;
}

header {
    width: 100%;
    height: 50px;
}

footer {
    float: left;
    width: 100%;
    height: 50px;
    text-align: center;
    line-height: 50px;
    
}


#main {
    margin: 0 auto;
    position: relative;
    width: 1440px;
}


#sidebar {
    position: relative;
    float: left;
    width: 200px;
    margin-top: 150px;
}

nav {
    width: 200px;
    top: 175px;
}

ul {
    list-style: none;
    padding-left: 0px;
}

#sidebarul {
    padding-left: 65px;

}

li {
    font-size: 20px;
    width: 135px;
    height: 20px;
    padding-top: 30px;
    padding-bottom: 30px;
    font-weight: 100;
}

#maintext {
    position: absolute;
    top: 345px;
    left: 470px;
    font-size: 60px;
    color: #f41f56;
    font-weight: 700;
    z-index: 2;
}

#mainsubtext {
    position: absolute;
    top: 460px;
    left: 470px;
    width: 230px;
}

#mainsubtext > p:nth-child(1) {
    font-size: 30px;
}

#mainsubtext > p:nth-child(2) {
    font-size: 15px;
}

#mainimg {
    width: 600px;
    height: 526px;
    position: absolute;
    top: 112px;
    left: 840px;
    z-index: 1;
}

#mainimg > img {
    max-width: 100%;
}

/* about page*/
#about {
    position: relative;
    float: left;
    width: 1240px;
}


#aboutimg {
    float: left;
    margin-left: 60px;
    width: 375px;
    height: 500px;
}

#aboutimg > img {
    max-width: 100%;
}

#myname {
    width: 380px;
    height: 60px;
}

#myname > span {
    font-size: 30px;
    font-weight: 500;
}

#moto {
    float: left;
    margin-left: 100px;
    left: 730px;
    width: 600px;
    height: 205px;
    font-size: 50px;
}

#moto > .moto-left-text {
    display: inline-block;
    width: 270px;
}

#moto > .moto-right-text {
    display: inline-block;
    font-weight: 700;
    width: 310px;
}

#moto > .margin {
    margin-top: 25px;
    margin-bottom: 25px;
}

#introduce {
    float: left;
    margin-left: 100px;
    margin-top: 80px;
    width: 600px;
    height: 210px;
}

#introduce > span {
    font-size: 30px;
    font-weight: 700;
}

#introduce > p {
    font-size: 20px;
    letter-spacing: 1px;
    line-height: 35px;
    margin-top: 50px;
}

#myskills {
    float: left;
    margin-left: 100px;
    margin-top: 80px;
    width: 600px;
    height: 540px;
}

#myskills > .title {
    display: inline-block;
    font-size: 30px;
    font-weight: 500;
    margin-bottom: 40px;
}

#myskills > .skill {
    float: left;
    width: 600px;
    margin-bottom: 10px;
}

#myskills > .skill:nth-last-child(1) {
    margin-bottom: 0;
}

#myskills > .skill > .skillname {
    display: inline-block;
    width: 300px;
    font-size: 20px;
    font-weight: 500;
    margin-bottom: 10px;
}

#myskills > .skill > .progressbar {
    display: inline-block;
    width: 520px;
    height: 21px;
    background-color: #d6d3d3;
    border-radius: 10px;
}

#myskills > .skill > .progressbar > .gauge {
    display: inline-block;
    width: 10%;
    height: 21px;
    background-color: #3abff7;
    border-radius: 10px;
    transition: 1s linear;
}

#myskills > .skill > .skillper {
    display: inline-block;
    width: 60px;
    height: 21px;
    text-align: center;
    font-size: 15px;
    font-weight: 100;
}


/* portfolio */
#portfolio {
    position: relative;
    float: left;
    width: 1240px;
}

#portfolio > .title {
    font-size: 60px;
    font-weight: 900;
    text-align: center;
}

#portfolio > .content {
    float: left;
    margin-top: 50px;
    width: 1240px;
}

#portfolio > .content > .image {
    float: left;
    width: 500px;
    margin-left: 60px;
}

#portfolio > .content > .image > img {
    max-width: 100%;

}

#portfolio > .content > .textcontent {
    float: left;
    width: 680px;
}

#portfolio > .content > .textcontent > .subtitle {
    font-size: 35px;
    font-weight: 400;
    text-align: center;
}

#portfolio > .content > .textcontent > .subtitle > span {
    padding: 10px;
    color: white;
    background-color: black;
    display: inline-block;
}

#portfolio > .content > .textcontent > .subdescription {
    font-size: 20px;
    font-weight: 100;
    margin-top: 40px;
    text-align: center;

}

#portfolio > .content > .textcontent > .subdescription > span {
    display: inline-block;
    width: 500px;
    text-align: left;
}

#portfolio > .content > .textcontent > .sublink {
    font-size: 25px;
    font-weight: 300;
    margin-top: 30px;
    text-align: center;
}

#portfolio > .content > .textcontent > .sublink > span {
    display: inline-block;
    width: 500px;
    text-align: left;
}

/* contact */

#contact {
    position: relative;
    float: left;
    width: 1240px;
}

#contact > .contactinfo {
    float: left;
    margin-left: 50px;
    margin-top: -50px;
    width: 350px;
    height: 900px;
    background-color: #eeeeee;
}

#contact > .contactinfo > .title {
    font-size: 60px;
    font-weight: 900;
    margin-top: 50px;
    margin-bottom: 50px;
    text-align: center;
}

#contact > .contactinfo > span {
    display: inline-block;
    width: 100%;
    height: 10px;
    background-color: white;
}


#contact > .contactinfo > .inquiries > span {
    display: inline-block;
    width: 320px;
    margin-top: 50px;
    margin-left: 30px;
}


#contact > .contactform {
    float: left;
    width: 840px;
    height: 850px;
}

#contact > .contactform > form {
    width: 540px;
    margin-left: 150px;
    margin-top: 100px;
}

#contact > .contactform > form > label {
    display: inline-block;
    width: 150px;
    height: 30px;
    font-size: 30px;
    font-weight: 300;
    vertical-align: top;
    margin-top: 54px;


}

#contact > .contactform > form > input {
    width: 370px;
    height: 30px;
    margin-top: 50px;
    border: 3px solid black;
}

#contact > .contactform > form > #msg {
    height: 90px;
}

/*font-style*/

.subtitle {
    font-size: 30px;
    font-weight: 400;
}

.thin10{
    font-size: 10px;
    font-weight: 100;
}

.thin20 {
    font-size: 20px;
    font-weight: 100;
}

- 처음 계획을 하면서 이부분을 신경 쓰지 않는다면 진행 과정중에서 수정을 해야할 일들이 생기게 됩니다.

- 다음 포스팅에서는 jQuery를 통해 기능들을 추가해 보면서 , 디자인을 하나씩 수정해 나가는 과정을 진행해 보겠습니다.

728x90
728x90

  Contact 페이지 컨텐츠 추가   

- 이전 포스팅에서 contact 페이지의 레이아웃을 구성하고 form 태그 안의 label 태그와 input 태그의 스타일과 크기,위치를 지정해줬습니다.

- 이번 포스팅에서는 div.contactinfo의 title과 iquirise 부분을 추가 하여 contact 페이지를 완성 시켜 보겠습니다.

 

  단계  

1. div.title 크기 위치 지정

2. span 추가 및 구분선 만들기

3. div.inquiries 크기 위치 지정

 

 

1. div.title 크기 위치 지정  

- div.title의 크기와 위치 / 폰트 크기와 스타일을 지정해 주겠습니다.

 

- div. title의 폰트 크기와 스타일은 font-size : 60px , font-weight : 900 입니다.

- div.contactinfo가 상단으로 50px 만큼 올라가 있기 때문에 div.title을 50px만큼 내려줘야합니다.

- margin-top 값으로 50px만큼 지정합니다.

- 가운데 정렬 시키기 위해 text-align 값으로 center를 지정하고 , 아래쪽에 간격을 주기위해 margin-bottom 값으로 50px 만큼 지정합니다.

 

#contact > .contactinfo > .title {
    font-size: 60px;
    font-weight: 900;
    margin-top: 50px;
    margin-bottom: 50px;
    text-align: center;
    background-color: skyblue;
}

- 타이틀 완성 !!

  2 span 추가 및 구분선 만들기

- div.title밑으로 흰색 구분선이 있습니다.

 

- div.title의 border-bottom 값을 주어서 만들수도 있지만, span태그를 추가 해서 만들어 보겠습니다.

- div.title 과 div.inquiries 사이에 span태그를 추가해 줍니다.

 

	<div class="title">
            Contact
        </div>
        <span></span>
        <div class="inquiries">
            Inquiries
        </div>

- span을 display: inline-block으로 만들고 width 값으로 100% , height 값으로 10px , background-color값을 white로 지정합니다.

 

#contact > .contactinfo > span{
    display: inline-block;
    width: 100%;
    height: 10px;
    background-color: white;
}

 

- 구분선이 생겼습니다.!!

 

  3. div.inquiries 크기 위치 지정  

- 이제 마지막으로 div.inquiries의 크기와 위치를 지정해주고 텍스트를 추가해 준 뒤 스타일을 지정해 보겠습니다.

 

 

- div.inquiries의 크기를 우선 지정해 주겠습니다.

- 가로 크기값으로 100%를 지정하고 background-color값으로 skyblue를 줘서 확인해 보겠습니다.

 

- Inquiries에 들어갈 컨텐츠들을 확인해 보고 div.inquiries 안에 태그들과 텍스트들을 추가해 주겠습니다.

- 들어가는 컨텐츠들은 3부분으로 나뉩니다. 

- 각각 텍스트가 들어갈 span태그를 3개 추가해주고 텍스트들을 넣어 주겠습니다.

- 첫번째에 들어가는 텍스트인 Inquiries의 스타일만 다르고 나머지는 똑같습니다.

- span들 사이에 간격을 주기 위해 margin-top 값으로 50px을 margin-left 값으로 30px만큼줍니다.

- span을 display : inline-block으로 만들고 가로크기 값으로 320px을 지정한뒤 font-size : 20px / font-weight : 100을 지정해 줍니다.

#contact > .contactinfo > .inquiries> span{
    display: inline-block;
    width: 320px;
    font-size: 20px;
    font-weight: 100;
    margin-top:50px;
    margin-left: 30px;
}

 

 

 

 

- css에서 첫번째 span만 nth-child를 이용해 스타일을 변경할 수 있지만, 항상 텍스트들을 추가할때마나 span값을 지정하는 방법은 너무 귀찮아 질 수도 있습니다. font스타일에 해당하는 값들을 지정해놓은 css스타일을 미리 만들어두고 , class를 지정하여 사용하면 편리할 것 같습니다.

- div.contactinfo > span의 css값들중 font에 해당하는 부분들을 우선 삭제 처리합니다.

- css에 .subtitle이라는 선택자를 만들어 font-size : 30px, font-weight: 400을 지정하고 첫번째 span에 class값으로 subtitle을 지정합니다

- 다음으로 .thin20이라는 선택자를 만들고 font-size:20px;, font-weight:100을 지정하여 2번째 , 3번째 span에 class 값으로 thin20을 지정합니다.

 

#contact > .contactinfo > .inquiries>span{
    display: inline-block;
    width: 320px;
    margin-top:50px;
    margin-left: 30px;
}


/*font-style*/

.subtitle{
    font-size: 30px;
    font-weight: 400;
}

.thin20{
    font-size: 20px;
    font-weight: 100;
}

 

 

- 잘 적용 된 모습입니다.

- 전체적인 페이지의 모습을 확인해 보겠습니다.

 

 

 

- 완성!!

- 이로서 contact 페이지도 완성 되었습니다.

- 다음 포스팅에서는 footer부분을 진행해 보겠습니다.

728x90
728x90
728x90

+ Recent posts