stomach 2023. 11. 28. 09:37
 text-shadow: black 1px 0 10px;

1px 그림자크기

0 번짐정도

10px 그림자 채도 수준

 

 

결과

 

 

 

 

 

.section1 { display: flex;
            align-items: center;
            flex-direction: column;
            background-image: url(pink.jpg) ;
            background-size: cover;

 flex-direction: column;

 

 

 

 

justify-content: center;

 

 

 

.section1 { display: flex;
            align-items: start; /*aline 과 direction이 반대가 되는상황*/
            flex-direction: column; /*세로정렬*/
            justify-content: center;
            background-image: url(pink.jpg) ;
            background-size: cover;

 

 

html에 <p> 태그 추가

<section class="section1">
        <h2>여성 대상으로 진행되는 디자인 교육</h2>
        <p>비전공자를 위한 첫 코딩 챌린지</p>
    </section>

 

css에 ection1 p 추가해서 

.section1 h2, section1 p {
    margin-left: 20px;
    color : white;
    text-shadow: black 5px 0 10px;
    font-family: 'TAEBAEKmilkyway';
    font-size: 2em;
}

 

 

추가로 

.section1 p {
    font-size: 3em;
}

 

위에 보다 아래에

p에 좁은영역을 추가해서 따로 폰트사이즈 추가하는게 합리적이다

 

 

 

<총정리 코드>

@font-face {
    font-family: 'TAEBAEKmilkyway';
    src: url('https://cdn.jsdelivr.net/gh/projectnoonnu/noonfonts_2302@1.0/TAEBAEKmilkyway.woff2') format('woff2');
    font-weight: normal;
    font-style: normal;
}

@font-face {
    font-family: 'JeonjuCraftMjB';
    src: url('https://cdn.jsdelivr.net/gh/projectnoonnu/noonfonts_2310@1.0/JeonjuCraftMjB.woff2') format('woff2');
    font-weight: 700;
    font-style: normal;
}

@font-face {
    font-family: 'Giants-Inline';
    src: url('https://cdn.jsdelivr.net/gh/projectnoonnu/noonfonts_2307-1@1.1/Giants-Inline.woff2') format('woff2');
    font-weight: normal;
    font-style: normal;
}

h1, h2, p {
    margin: 0;
}

/*사이트 제목과 그 아래에는 관련된 디자인이 들어감*/
header {
    background-color: #F2BDBD;
    width: 100%;

    height: 100px;
    display: flex;
    justify-content: center; /*가로 중앙 정렬*/
    align-items: center; /*세로 중앙 정렬*/
    font-family: 'Giants-Inline';
    font-size: 2.5em
    
}
header h1{
    color :#358C74;
    
}

/*전체 섹션1에 대한 디자인*/
section {
    background-color: #48D9B0;
    border: 2px solid #358C74;
    height: 100vh; /* vh단위는 브라우저창의 비율*/
    font-family: 'Giants-Inline';
}

/*세션1에 대한 디자인*/
.section1 { display: flex;
            align-items: start; /*aline 과 direction이 반대가 되는상황*/
            flex-direction: column; /*세로정렬*/
            justify-content: center;
            background-image: url(pink.jpg) ;
            background-size: cover;

}
.section1 h2, section1 p {
    margin-left: 20px;
    color : white;
    text-shadow: black 5px 0 10px;
    font-family: 'TAEBAEKmilkyway';
    font-size: 2em;
}

.section1 p {
    font-size: 3em;

 

<!DOCTYPE html>
<html lang="en">
<head>
    <title>디지털 디자인 교육</title>
    <link rel="stylesheet" href="style.css">
</head>
<body>
    <!-- 웹사이트 제목 -->
    <header>
        <h1>디지털 디자인 교육</h1>
    </header>

    <!-- 섹션1 웹사이트 설명-->
    <section class="section1">
        <h2>여성 대상으로 진행되는 디자인 교육</h2>
        <p>비전공자를 위한 첫 코딩 챌린지</p>
    </section>

 

 

 

 

 

 

html에 돌아와서

<section class="section2">
        <div class="gallery">

        <div>사진 들어갈 공간</div>
        <div>사진 들어갈 공간</div>
        <div>사진 들어갈 공간</div>
        </div>
    </section>

<section> 과

<div> 에 따로 클래스 지정해서 서로 다른 효과주기.

 

<div class="pic1">사진 들어갈 공간</div>
 <div class="pic2">사진 들어갈 공간</div>
  <div class="pic3">사진 들어갈 공간</div>

 

이어서 각 따로 효과를 주기위해 div에 서로 다른 이름으로 클래스로 명명한다.

 

여태까지는 큰 범위먼저 진행했고, 이제는 사진 먼저 넣기.

css에 추가로

/*pic을 먼저 한 이유는, div 태그를 사용하고 있기 때문에
는 공간을 확인하기 어려워서 미리 지정함 */
/*section2 디자인*/
.pic1, .pic2, .pic3 {
    width: 200px;
    height: 300px;
    background-color: gray;
   
}

 

결과

 

 

 

tip) 

 

 

- 스크롤을 내릴 때 고정하는 방법

header {
    background-color: #F2BDBD;
    width: 100%;

    position: fixed;
    height: 100px;
    display: flex;
    justify-content: center; /*가로 중앙 정렬*/
    align-items: center; /*세로 중앙 정렬*/
    font-family: 'Giants-Inline';
    font-size: 2.5em
    
}

header에 position: fixed; 추가하기

 

- 스크롤 내리면 상단 부분에 빈공간이 보일 수 있는데,

css 파일

 

body를 추가해서 margin 0 을 주면

스크롤 부분의 빈공간을 채울 수 있다.

 

 

css

pic 위에

 


.gallery {
    display: flex;
}

가로로 정렬

 

 

 

 

-

.gallery {
    display: flex;
    justify-content: space-around;
}

 

 

.gallery {
    display: flex;
    justify-content: end;
}

 

 

 

.pic1, .pic2, .pic3 {
    width: 200px;
    height: 300px;
    background-color: gray;
    margin: 20px;
   
}

margin 추가

 

위치가 여전히 안맞다

 

 

.pic1, .pic2, .pic3 {
    width: 25vw;  /*vw은 화면 넓이사이즈 기준으로 비율*/
    height: 80vh; /*vh는 화면의 높이사이즈 기준으로 비율*/
    background-color: gray;
    margin: 20px;
   
}

width 와 height의 수치와 단위를 바꾸면

 

 

 

여기서 모서리가 너무 딱딱하면

border-radius를 추가한다

 

 

회색 태두리가 동그랗게 된다

 

 

-이제 각 칸에 이미지를 넣어보기-

 

pic1 pic2 pic3

 

 

 

 

/*이미지 넣는 공간, 주석으로 미리 추가하면
 추후 이미지 수정시 금방 찾을 수 있어 편리함*/
.pic1 {
    background-image: url(pic1.jpg);
    background-size: cover;  
}
.pic2 {
    background-image: url(pic2.png);
    background-size: cover;   
}

.pic3 {
    background-image: url(pic3.png);
    background-size: cover;   
    background-position: center;
}

 /*backround-size: cover는지정된 틀 딱 맞게 넣어주는 기능 사진이 크면 잘림*/
 /*pic3사진은 그림이 짤려서 , 그림을 중앙을 포커스

 

 

 

 

 

 

이제 전제 section 의 컬러를 수정. 왜냐하면 저 초록색이 거슬리기 때문에

 

선이랑 색깔을 없앴더니

 

결과: 차이점은 section 큰 파트 배경화면 초록색이 사라지고, 언발란스한 테두리가 사라졌다.

 

보통 처음에 가이드라인으로 색 지정 먼저하고, 그림 채우면 그 뒤에 가이드라인 색은 지우는게 깔끔하게 진행된다.

이미지 태그만 쓰면 글자 안에 글이 안들어가는데

div 태그 쓰면 이미지 위에 글자가 들어간다. 보통 웹페이지는 이렇게 활용한다.

 

 

 

 

 

저 글자가 거슬리니 가운데에 옮겨보자

 

display: flex; 써도 왜 변화가 없는지?

 

 

 

 

 

글자색 color 추가

filer 포토샵 효과

font-size 추가함

 

 

span 태그안에 a 태그 넣기

 

 

 

 

 

 

더보기 위치를 끝으로 옮기기 

 

HTML , span 태그에 class 입히기
class 입힌 more에 안에 태그 추가. 처음엔 범위 먼저, 그다음 이동수준 설정

 

처음엔 범위 먼저, 그다음 이동수준 설정

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

padding 은 안쪽 공간 범위

margin 은 바깥쪽 공간 범위 설정시 이용

 

/*푸터 디자인*/
 footer {
    background-color: #F2BDBD;
    height: 60px;
    font-family: 'JeonjuCraftMjB';
    text-align: center;
    padding: 40px;

}

/* 안쪽 공간 범위는 padding, 바깥쪽 범위는 margin을 주로 사용함*/

 

 

 

 

pic1.jpg
0.04MB
pic2.png
0.13MB
pic3.png
0.09MB
pink.jpg
0.06MB
style.css
0.00MB
연습.html
0.00MB

 

 

 

결과 영상