- 앵커 (anchor) : 한 페이지 안에서 지정된 위치로 점프하여 스크롤

 

a태그를 클릭하면 위치로 점프 

    <a href="#앵커이름"></a>

    <태그이름 id="앵커이름"></> 

smooth scrolling

1. html { scroll-behavior: smooth; }

2. jquery scrollTo 플러그인 이용 

 

 

 

    <div class="container">
        <header>
            <!-- <a href="#none"><img src="img/naverband/logo-band.png" alt=""></a> -->
            <a href="#part1">html part</a>
            <a href="#part2">css part</a>
            <a href="#part3">jquery part</a>
            <a href="#part4">portfolio part</a>
        </header>  
        <h1 id="part1">html part</h1>
        <hr>
        <p>
            lorem200
        </p>
        <a href="#" class="btn-gototop">Go to top</a>
        
        <h1 id="part2">css part</h1>
        <hr>
        <p>
            lorem200
        </p>
        <a href="#" class="btn-gototop">Go to top</a>
        <h1 id="part3">jquery part</h1>
        <hr>
        <p>
            lorem200
        </p>
        <a href="#" class="btn-gototop">Go to top</a>
        <h1 id="part4">portfolio part</h1>
        <hr>
        <p>
            lorem200
        </p>
        <a href="#" class="btn-gototop">Go to top</a>
html {
    /* IE는 안됨 */
    scroll-behavior: smooth;
}
body {
    /* font-family: 'Raleway', 'sans-serif'; */
    /* font-family: 'Noto Sans KR', 'sans-serif'; */
    font-family: 'Montserrat', sans-serif;

    margin: 0;
    line-height: 1.5em;
    background-color: #eee;
    color: #222;
}
a {
    text-decoration: none;
    color: #000;
}
ul {
    list-style: none;
}
.container {
    margin: 20px;
}
header {

}
header a {
    padding: 10px 20px;
    background-color: teal;
    color: #fff;
    text-transform: uppercase;
}
.container p {
    font-size: 1.5em;
    line-height: 2em;
}
.btn-gototop {
    padding: 10px 20px;
    background-color: pink;
    color: #fff;
    border-radius: 20px;
}

 

 

 - jquery scrollTo 플러그인 이용 

<head>
    <title>Document</title>
    <script src="script/jquery-3.4.1.min.js"></script>
    <script src="script/jquery.scrollTo.min.js"></script>
</head>
<body>


    <!-- Smooth Scroll -->
    <script>
        $('header a, .btn-gototop').click(function() {
            // 0.9s
            $.scrollTo(this.hash || 0, 900);
            e.prventDefault();
        });
    </script>
    <!-- Smooth Scroll -->
</body>

 

 

jquery.scrollTo.min.js
0.00MB
jquery-3.4.1.min.js
0.08MB

'Web > HTML CSS 퍼블리싱' 카테고리의 다른 글

Hamburger Menu (+, ~ 선택자 이용)  (0) 2021.07.22
iframe, a target속성  (0) 2021.07.22
login form #2  (0) 2021.07.21
크롬 확장 프로그램 추천  (0) 2021.07.20
login form #1  (0) 2021.07.08

 

a*3 - 폰트어썸 유니코드 사용

버튼 백그라운드 linear-gradient()

그라디언트 참고 사이트 : https://webgradients.com/

 

Free Gradients Collection by itmeo.com

Free collection of 180 background gradients that you can use as content backdrops in any part of your website.

webgradients.com

 

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
<div class="container">
    <section>
            <div class="login">
                <div class="login-header">
                    <h1>Log in</h1>
                    <span></span>
                </div>
                <div class="login-type-sns">
                    <a class="sns" href="#none"></a>
                    <a class="sns" href="#none"></a>
                    <a class="sns" href="#none"></a>
                    <span class="or-text">or use your email</span>
                </div>
                <div class="login-email">
                    <label for="email-chk">Email</label>
                    <input type="email" id="email-chk" placeholder="Email"> 
                    <label for="pw-chk">Password</label>
                    <input type="password" id="pw-chk" placeholder="Password">
                </div>
                <div class="login-footer">
                    <div class="forgot-pw">
                      <input class="left" type="checkbox" id="keep-login"> 
                       <label for="keep-login">Remember Me</label>
                      <a class="right" href="#none">Forgot Password?</a>
                    </div>
 
                    <div class="btn">Submit</div>
                    <div class="terms">
                        <a class="left" href="#none">Privacy Policy</a>
                        <a class="right" href="#none">Terms & Conditions</a>
                    </div>
                    
                </div>
            </div>
    </section>        
</div>
 
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
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
 
148
149
150
151
152
153
154
155
156
157
158
159
160
/* Google Web Font */
@import 
url('https://fonts.googleapis.com/
css2?family=Raleway:wght@300;500&display=swap'
);
/* 폰트어썸 4.7 */
@import 
url('https://stackpath.bootstrapcdn.com/
font-awesome/4.7.0/css/font-awesome.min.css'
);
/* default css */
/* 폰트 기본값 : 16px = 1em = 100% = 12pt */
body {
    font-family: 'Raleway', 'sans-serif';
    margin: 0;
    line-height: 1.5em;
    background-color: #eee;
    color: #222;
}
{
    text-decoration: none;
    color: #000;
}
h1 {
    margin: 0;
}
section {
    position: relative;
    height: 100vh;
    border: 1px solid #000;
}
.login {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 480px;
    height: 670px;
    background-color: #fff;
    border-radius: 20px;
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.363);
}
.login-header {
    margin-top: 80px;
    text-align: center;
    /* border: 1px solid #000; */
}
.login-header:hover span {
    width: 120px;
}
.login-header h1 {
    margin: 15px 0;
    font-size: 35px;
}
.login-header span {
    display: inline-block;
    width: 45px;
    height: 6px;
    background: linear-gradient(to left, #7028e4 0%, #e5b2ca 100%);
    transition: 0.3s;
}
.login-type-sns {
    margin-top: 5px;
    /* border: 1px solid blue; */
    text-align: center;
}
.sns {
    margin: 5px 0;
    margin-right: 5px;
    display: inline-block;
    width: 45px;
    height: 45px;
    border: 1px solid lightgray;
    border-radius: 50%;
    box-shadow: 0 4px 5px rgba(0, 0, 0, 0.226);
}
.sns:before {
    content: '\f09a';
    font-family: fontawesome;
    line-height: 45px;
    font-size: 20px;
}
.sns:nth-child(1):before {
    content: '\f09a';
}
.sns:nth-child(2):before {
    content: '\f0e1';
}
.sns:nth-child(3):before {
    content: '\f099';
}
.or-text {
    display: block;
    margin: 10px 0;
    font-size: 14px;
}
.login-email {
    padding: 0 60px;
}
.login-email input {
    display: block;
    padding: 20px;
    margin: 10px;
    width: 85%;
    border: 1px solid rgba(211, 211, 211, 0.712);
    border-radius: 15px;
    outline: none;
}
.login-email input:focus {
    border: 1px solid #7028e4;
}
.login-email input::placeholder {
    color: lightgray;
}
.login-email label {
    font-size: 14px;
    font-weight: bold;
}
.login-footer {
    padding: 0 60px;
}
.forgot-pw {
    overflow: hidden;
    font-weight: bold;
    padding: 10px;
    font-size: 14px;
}
.forgot-pw input {
    margin-top: 5px;
}
.forgot-pw label[for=keep-login] {
    margin-left: 5px;
    letter-spacing: .5px;
}
.forgot-pw a:hover {
    text-decoration: underline;
}
.left {
    float: left;
}
.right {
    float: right;
}
.btn {
    padding: 15px;
    margin: 10px;
    width: 85%;
    background: linear-gradient(to left, #7028e4 0%, #e5b2ca 100%);
    color: #fff;
    font-size: 20px;
    /* border: 1px solid transparent; */
    border-radius: 50px;
    box-shadow: 0 5px 20px #7028e449;
    text-align: center;
    cursor: pointer;
}
.terms {
    overflow: hidden;
}
.terms a {
    margin-top: 20px;
    font-weight: bold;
    font-size: 14px;
}
cs

'Web > HTML CSS 퍼블리싱' 카테고리의 다른 글

iframe, a target속성  (0) 2021.07.22
앵커 (anchor) 만들기  (0) 2021.07.22
크롬 확장 프로그램 추천  (0) 2021.07.20
login form #1  (0) 2021.07.08
full screen 검색창  (0) 2021.07.06

 

1) page ruler redux

브라우저 화면에서 드래그 -> 너비와 높이 알 수 있음

 

 

 

 

2) Image Downloader 

종류가 많으니까 아무거나 설치 

 

 

 

3) CSSViewer

브라우저에서 원하는 요소의 CSS 스타일을 체크

 

 

 

4) ColorZilla

원하는 요소 색상값을 보거나 추출하거나 색상 관련 확장프로그램

 

 

 

5) Responsive Web Design Tester

활성화된 브라우저 화면을 모바일 기기에 따라 반응형 상태를 확인할 수 있는 반응형 웹사이트 제작시 활용되는 확장프로그램

 

 

 

6) Nimbus

활성화된 브라우저 화면을 이미지 형태로 캡쳐하는 브라우저 화면 캡쳐 전문 프로그램. 부가 기능으로서 브라우저 화면을 동영상으로 레코딩하는 기능도 있음

 

 

 

 

https://chrome.google.com/webstore/category/extensions?hl=ko 

 

Chrome 웹 스토어

Chrome에 사용할 유용한 앱, 게임, 확장 프로그램 및 테마를 찾아보세요.

chrome.google.com

 

'Web > HTML CSS 퍼블리싱' 카테고리의 다른 글

앵커 (anchor) 만들기  (0) 2021.07.22
login form #2  (0) 2021.07.21
login form #1  (0) 2021.07.08
full screen 검색창  (0) 2021.07.06
프로필 카드 ui #1 hover effec  (0) 2021.07.06

폼 관련 가상클래스를 활용한 로그인 화면

<span>Email</span> 

span에 display:block 또는 div로 해도 됨

 

체크박스는 왼쪽float a태그는 오른쪽float 

부모요소에 overflow: hidden 필요 

1
2
3
4
5
6
7
8
9
10
11
12
13
14
    <form action="" class="login">
        <span>Email</span>
        <input type="email" placeholder="Email Address">
        <span>Password</span>
        <input type="password" placeholder="Password">
        <p>
            <label>
                <input type="checkbox"> Keep me logged in 
            </label>
            <a href="" class="btn-forgot">Forgot Your Password</a>
        </p>
        <button>Log in</button>
    </form>
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
body {
    margin: 0;
    line-height: 1.5em;
    font-weight: normal;
 
    /* 중앙정렬 */
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100vh;
 
    color: #222;
}
{
    color: #222;
}
.login {
    width: 800px;
    padding: 25px;
    box-sizing: border-box;
    box-shadow: 0 0 25px rgba(0, 0, 0, 0.205);
    background-color: #f5f5f5;
    border: 1px solid #eee;
    border-radius: 5px;
}
.login span {
    display: block;
    font-weight: bold;
    margin-top: 20px;
}
.login input[type=email],
.login input[type=password] {
    width: 100%;
    padding: 15px;
    box-sizing: border-box;
    border: 1px solid #ddd;
    border-radius: 5px;
    outline: none;
    transition: 0.3s;
    padding-left: 50px;
}
.login input[type=email]:hover,
.login input[type=password]:hover {
    border: 1px solid dodgerblue;
    box-shadow: 0 0 5px dodgerblue;
}
.login input[type=email] {
    background: #fff url(../img/icon-email.png) no-repeat center left 10px;
}
.login input[type=password] {
    background: #fff url(../img/icon-lock.png) no-repeat center left 10px;
}
.login input[type=email]::placeholder,
.login input[type=password]::placeholder {
    opacity: 1;
    transition: 0.3s;
}
 
/* 클릭했을 때 placeholder 없애기 : 
visibility: hidden; 만 있어도 되지만 트랜지션을 넣고싶으면 opacity 이용 */
.login input[type=email]:focus::placeholder,
.login input[type=password]:focus::placeholder {
    visibility: hidden;
    opacity: 0;
}
 
/* p : 부모
자식요소가 float -> 부모요소의 높이값 잃는다. 부모 오버플로우 히든 필요 */
.login p {
    /* border: 1px solid red; */
    overflow: hidden;
}
.login p label {
    float: left;
    cursor: pointer;
}
.login p .btn-forgot {
    float: right;
}
.login p .btn-forgot:hover {
    text-decoration: underline;
}
.login button {
    width: 300px;
    padding: 10px;
    border: none;
    border-radius: 5px;
    font-size: 24px;
    cursor: pointer;
    background-color: #2991b1;
    color: #fff;
    transition: 0.3s;
}
.login button:hover {
    background-color: #2c778e;
}
cs

 

 

body 에 백그라운드 이미지 넣고 body:before에 백그라운드 색상을 어두운 색으로 오버레이 

z-index: -1 로 설정해서 input요소 뒤로 감  

 

1
2
3
4
5
    <form action="" class="search">
        <h1>What are you looking for?</h1>
        <input type="text" placeholder="Type...">
        <input type="submit" value="Search">
    </form>
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
body {
    margin: 0;
    line-height: 1.5em;
    font-weight: 300;
 
    background: url(../img/snow-photo.jpg) no-repeat center center;
    /* 브라우저에 가득차게 */
    background-attachment: fixed;
 
    /* background-image: url();
    background-repeat: no-repeat;
    background-position: center center;
   background-attachment: fixed; 와

background: url() no-repeat center center fixed 는 같다 */
}
/* 오버레이 */
body:before {
    content: '';
    position: absolute;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
    background-color: rgba(0, 0, 0, 0.596);
    z-index: -1;
}
.search {
    /* border: 1px solid #fff; */
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}
.search h1 {
    color: #fff;
    text-align: center;
    font-weight: normal;
    margin-bottom: 30px;
    font-size: 40px;
}
.search input[type=text],
.search input[type=submit] {
    padding: 20px;
    box-sizing: border-box;
    border: none;
    outline: none;
}
.search input[type=text] {
    width: 350px;
    padding-left: 40px;
    border-radius: 40px 0 0 40px;
    outline: none;
    margin-right: -6px;
}
.search input[type=submit] {
    width: 150px;
    background-color: orange;
    color: #fff;
    border-radius: 0 40px 40px 0;
    cursor: pointer;
}
.search input[type=submit]:hover {
    background-color: darkgoldenrod;    
}
.search input[type=text]::placeholder {
    font-style: italic;
    font-size: 20px;
}
cs

 

 

 

 

- html

container > card*3

 
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
    <div class="container">
        <div class="card">
            <img src="img/crew/crew-01.jpg" alt="">
            <div class="content">
                <h2>
                    Andrew Yu 
                    <span>Developer</span>
                </h2>
                <p>
                    Lorem ipsum dolor sit amet consectetur adipisicing elit. 
                    Excepturi harum aperiam eius ad deserunt sed!
                </p>
                <div class="sns">
                    <a href="#none">
                        <i class="fa fa-facebook"></i>
                    </a>
                    <a href="#none">
                        <i class="fa fa-twitter"></i>
                    </a>
                    <a href="#none">
                        <i class="fa fa-instagram"></i>
                    </a>
                </div>
            </div>
        </div>
        <div class="card">
            <img src="img/crew/crew-02.jpg" alt="">
            <div class="content">
                <h2>
                    Monica Jung 
                    <span>Designer</span>
                </h2>
                <p>
                    Lorem ipsum dolor sit amet consectetur adipisicing elit. 
                    Excepturi harum aperiam eius ad deserunt sed!
                </p>
                <div class="sns">
                    <a href="#none">
                        <i class="fa fa-facebook"></i>
                    </a>
                    <a href="#none">
                        <i class="fa fa-twitter"></i>
                    </a>
                    <a href="#none">
                        <i class="fa fa-instagram"></i>
                    </a>
                </div>
            </div>
        </div>
        <div class="card">
            <img src="img/crew/crew-03.jpg" alt="">
            <div class="content">
                <h2>
                    James Lee
                    <span>Planner</span>
                </h2>
                <p>
                    Lorem ipsum dolor sit amet consectetur adipisicing elit. 
                    Excepturi harum aperiam eius ad deserunt sed!
                </p>
                <div class="sns">
                    <a href="#none">
                        <i class="fa fa-facebook"></i>
                    </a>
                    <a href="#none">
                        <i class="fa fa-twitter"></i>
                    </a>
                    <a href="#none">
                        <i class="fa fa-instagram"></i>
                    </a>
                </div>
            </div>
        </div>
    </div>
cs

 

 

- css

container (중앙정렬 : 포지션 absolute, left50% top50%, 트랜스폼 트랜스레이트(-50%, -50%) 또는 flex 

> card(가로배치 - 인라인블럭) 

hover 시 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
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
/* card.css */

.container {
/* 중앙정렬 */
    display: flex;
    height: 100vh;
    justify-content: center;
    align-items: center;
}
.card {
    position: relative;
    margin: 10px;
    width: 300px;
    height: 400px;
    overflow: hidden;
    transition: .5s;
}
.card .content {
    position: absolute;
    top: 100%;
    left: 0;
    padding: 20px;
    padding-top: 150px;
    box-sizing: border-box;
    width: inherit;
    height: inherit;
    color: #fff;
    text-align: center;
    transition: .5s;
}
/* .card .content:nth-child(1) X
-> card가 3개이고 card안에 .content는 한개있음
아래 crimson 불투명, 위 투명 (to top)
*/
.card:nth-child(1) .content {
    background: linear-gradient(to top, crimson, transparent);
}
.card:nth-child(2) .content {
    background: linear-gradient(to top, dodgerblue, transparent);
}
.card:nth-child(3) .content {
    background: linear-gradient(to top, yellowgreen, transparent);
}
.card .content h2 {
    font-size: 30px;
}
.card .content h2 span {
    display: block;
    font-size: 14px;
    color: gold;
    margin-top: 10px;
}
.sns a {
    color: #fff;
    display: inline-block;
    border: 1px solid #fff;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    line-height: 20px;
    font-size: 12px;
    text-align: center;
}
.card:hover .content {
    top: 0;
}
.card:hover {
    transform: translateY(-20px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.205);
}
cs
 
 
 

 

+ Recent posts