로고는 

position : absolute 로

좌측 상단에서 40 픽셀 

 

화면가운데 배치하는 방법은 로고와 방식은 동일하다 비율로 50%로씩 각각 적용하고

화면을 확인해보면 우측으로 쏠린것을 볼 수 있는데 이는

transform: translate(-50%,-50%); 

로 해결 이 가능하다 

 

애니메이션은 

@keyframes를 사용해서 함수호출하듯 사용하면 된다. 

 

 

 

@keyframes moveInLeft {

0% {

opacity: 0;

transform: translateX(-100px);

}

80% {

transform: translateX(20px);

}

100% {

opacity: 1;

transform: translateY(0);

}

}

 

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <!-- Font -->
 
    <!-- CSS -->
    <link rel="stylesheet" href="./css/style.css">
    
 
    <title>왕초보코딩탈출</title>
</head>
<body>
    <header class="header">
        <div class="logo-box">
            <img src="./img/logo-white.png" alt="logo"  class="logo">
        </div>
        <div class="text-box">
            <h1 class="heading-primary">
                <span class="heading-primary-main">왕초보코딩탈출</span>
                <span class="heading-primary-sub">Hello World!!</span>
            </h1>
        </div>
    </header>
</body>
</html>
http://colorscripter.com/info#e" target="_blank" style="color:#4f4f4ftext-decoration:none">Colored by Color Scripter
http://colorscripter.com/info#e" target="_blank" style="text-decoration:none;color:white">cs

 

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
 
{
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}
 
body {
    font-family: "Lato", sans-serif;
    font-weight: 400;
    font-size: 16px;
    line-height: 1.7;
    color:#777;
}
 
.header {
    height: 100vh;
    background-image: linear-gradient(
        to right bottom,
        rgba(232, 232, 232, 0.1),
        rgba(191, 191, 191, 0.1)),
    url("../img/main.jpg");
 
    background-size: cover;
    background-position: top;
    position: relative;
}
/* 로고 */
.logo-box {
    position: absolute;
    top:40px;
    left: 40px;
}
 
.logo {
    width: 120px;
    height: 70px;
}
 
 
.text-box {
    position: absolute;
    top:50%;
    left: 50%;
    transform: translate(-50%,-50%);
}
 
.heading-primary {
    color: #fff;
    backface-visibility: hidden;
}
 
.heading-primary-main {
    display: block;
    font-size: 60px;
    font-weight: 400;
    letter-spacing: 35px;
 
    animation-name: moveInLeft;
    animation-duration: 5s;
    
}
 
.heading-primary-sub {
    display: block;
    font-size: 20px;
    font-weight: 400;
    letter-spacing: 15px;
    text-transform: uppercase;
 
    animation-name: moveInRight;
    animation-duration: 5s;
}
 
@keyframes moveInLeft {
    0% {
        opacity: 0;
        transform: translateX(-100px);
    }
    80% {
        transform: translateX(20px);
    }
    100% {
        opacity: 1;
        transform: translateY(0);
    }
}
 
@keyframes moveInRight {
    0% {
        opacity: 0;
        transform: translateX(100px);
    }
    80% {
        transform: translateX(-20px);
    }
    100% {
        opacity: 1;
        transform: translateY(0);
    }
}
http://colorscripter.com/info#e" target="_blank" style="color:#4f4f4ftext-decoration:none">Colored by Color Scripter
http://colorscripter.com/info#e" target="_blank" style="text-decoration:none;color:white">cs

 

이미지에 그라데이션 추가하기

안녕하세요 왕초보 코딩 탈출입니다. 이것저것 많이하긴했지만 시간이 없다는 핑계로 블로그에 올리지 못했네요 ㅠ

퍼블리셔는  아니지만  웹이 앱이건 디자인이 많이 발목을 잡아서 CSS를 공부하면서 올려볼까합니다.  

 

배경이미지에 그라데이션을 주기위해서는  다음과 같이 

 

linear-gradient() 함수를 사용해야합니다.

 

그라데이션에 대하여 아래 링크에서 더 많은 정보를 확인하세요

https://developer.mozilla.org/ko/docs/Web/CSS/linear-gradient

 

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
 
{
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}
 
body {
    font-family: "Lato", sans-serif;
    font-weight: 400;
    font-size: 16px;
    line-height: 1.7;
    color:#777;
}
 
.header {
    height: 100vh;
    background-image: linear-gradient(
        to right bottom,
       rgba(232, 232, 232, 0.3),
       rgba(191, 191, 191, 0.3)),
    url("../img/main.jpg");
 
    background-size: cover;
    background-position: top;
}
 
 
 
 

다음과 같이 linear-gradient() 를 사용하여 전체 배경 이미지에 그라데이션 효과를 주었습니다.

역시나 미적 감각은 없어서 ... 만들고 나니 이쁘진 않네요 ㅎㅎ

배경이미지를 좀더 이쁜걸로 바꿔봐야겠어요 

 

 

 

번외로 이미지 모양을 조정하려면

https://bennettfeely.com/clippy/

 

Clippy — CSS clip-path maker

About Clip Paths The clip-path property allows you to make complex shapes in CSS by clipping an element to a basic shape (circle, ellipse, polygon, or inset), or to an SVG source. CSS Animations and transitions are possible with two or more clip-path shape

bennettfeely.com

소스확인

https://github.com/seojeounghoon/css_v1_MyHomePage

 

https://github.com/seojeounghoon/css_v1_MyHomePage

 

seojeounghoon/css_v1_MyHomePage

css project Hompage Design . Contribute to seojeounghoon/css_v1_MyHomePage development by creating an account on GitHub.

github.com

안녕하세요 왕초보 코딩 탈출입니다. 이것저것 많이하긴했지만 시간이 없다는 핑계로 블로그에 올리지 못했네요 ㅠ 

퍼블리셔는  아니지만  웹이 앱이건 디자인이 많이 발목을 잡아서 CSS를 공부하면서 올려볼까합니다.  

 

오늘은 간단하게 폰트설정하고 개발을 위해 기본 설정 하고 전체 배경 이미지를 넣겠습니다.

 

우선 폴더 구조는

index.html

css/style.css

img/

 

index.html 파일을 만들고 

css 와 img 폴더를 생성하고 

css 에는 style.css 파일을 생성합니다.

img폴더에는 차후에 이미지를 깃에 같이 포함해서 올릴테니 다운받으시면 됩니다. 

 

우선 기본 html 내용을 작성하고 

<link href="https://fonts.googleapis.com/css?family=Lato:100,300,400,700,900" rel="stylesheet">

다음과 같이 구글 폰트를 가져옵니다.

 

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <!-- Font -->
 
    <!-- CSS -->
    <link rel="stylesheet" href="./css/style.css">
    
 
    <title>왕초보코딩탈출</title>
</head>
<body>
    <header class="header">
        hello World!!!!
    </header>
</body>
</html>
 
 

 

다음으로 

모든 페이지의 margin, padding 을 0으로 주고  box-sizing: border-box 로 기본 설정하겠습니다.

 

그리고 body에 폰트의 기본 설정들과 컬러 라인높이등을 미리 설정해 둡니다.

 

1
2
3
4
5
6
7
8
9
10
11
12
13
14
 
{
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}
 
body {
    font-family: "Lato", sans-serif;
    font-weight: 400;
    font-size: 16px;
    line-height: 1.7;
    color:#777;
}
 

이제 index.html 에 작성해둔 header 에 전체 이미지 넣기

 

1
2
3
4
5
6
.header {
    height: 100vh;
    background-image: url("../img/main.jpg");
    background-size: cover;
    background-position: top;
}
 
 

결과 화면

프로젝트 마무리 시 수정 예정

+ Recent posts