Front-end/HTML&CSS

[웹 퍼블리싱] 02. HTML/CSS 핵심개념

Dev다D 2021. 2. 8. 10:53
반응형

마우스 오버 버튼

 

로그인 페이지 과제의 버튼에 작은 효과를 하나 주려고 합니다. 마우스를 '로그인' 버튼 위에 올릴 경우 로그인 버튼에 box-shadow 속성을 설정해주세요.

속성값은 위 사진에 나와 있듯이 box-shadow: 0 2px 4px 0 rgba(0, 0, 0, 0.50);입니다.

코드는 css/style.css에 작성해주세요.


 

마우스오버 작동 영상
<!DOCTYPE html>
<html>
<head>
    <title>버튼 디자인</title>
    <meta charset="utf-8">
    <link rel="stylesheet" href="Styles.css">
    <link href="https://fonts.googleapis.com/earlyaccess/notosanskr.css" rel="stylesheet">
</head>
<body>
<div class="login-form">
    <form>
        <input type="text" name="email" class="text-field" placeholder="아이디"><br>
        <input type="password" name="password" class="text-field" placeholder="비밀번호"><br>
        <input type="submit" value="로그인" class="submit-btn">
    </form>

    <div class="links">
        <a href="#">비밀번호를 잊어버리셨나요?</a>
    </div>
</div>
</body>
</html>
* {
    box-sizing: border-box;
    font-family: 'Noto Sans KR', sans-serif;
}

body {
    margin: 0;
    background-color: #1BBC9B;
}

.login-form {
    padding: 20px;
    background-color: #EEEFF1;
    width: 300px;
    display: block;
    margin: 50px auto auto auto;
    border-radius: 5px;

}

.text-field {
    font-size: 14px;
    border-style: none;
    padding: 10px;
    margin-bottom: 10px;
    border-radius: 5px;
    width: 260px;
    color: #9B9B9B;
}

.submit-btn {
    font-size: 14px;
    background-color: #1BBC9B;
    border-style: none;
    padding: 10px;
    margin: auto auto 20px auto;
    border-radius: 5px;
    width: 260px;
    color: white;

}

.submit-btn:hover {
    box-shadow: 0 2px 4px 0 rgba(0, 0, 0, 0.50);
}


.links {
    text-align: center;

}

.links a {
    font-size: 12px;
    color: #9B9B9B;

}

 


본 내용은 Codeit의  '웹 퍼블리싱' 강의를
참고하여 작성한 내용입니다.
반응형