본문 바로가기

일지/html

[web1]-3 (html,css) 버튼에 마우스를 갖다 대면 효과가 발생하게 하는 방법.

메인페이지에 만들것은

사이트의 제목, 카테고리 3개의 버튼 을 만들어야 합니다

"프로그래밍 언어"

라고 제목을 지어주었고 버튼을 만들어주었습니다.

버튼에 커서를 올려두면 효과가 발생하게 만들어주고 싶어서 

버튼에 커서를 올려두게되면 버튼이 돌며 색이 바뀌게 만들어만들었습니다.

 

 

버튼 효과

이런식으로 만들어봤습니.

소스코드는 GITHUB에 올려두겠습니다

https://github.com/memong1/html-button-effect

버튼코딩은

----HTML 코딩---

<!DOCTYPE html>
<html>
<head>
    <title>MAINPAGE</title>
    <meta charset="utf-8">
    <link rel="stylesheet" href="button.css">
</head>

<body style="background-color: rgb(70, 70, 70);">
    <strong><p style="text-align: center; color: aliceblue; font-size: 400%;">PROGRAMING LANGUAGE</p><hr></strong>
    <br><br><br>
    <div style="text-align: center;">
    <button class="circle_btn" onclick="location.href='web.html'">WEB</button >
    <button class="circle_btn" onclick="location.href='game.html'">GAME</button >
    <button class="circle_btn" onclick="location.href='data.html'">DATA</button >
    </div>
</body>
</html>

---------CSS 코딩---------

.circle_btn {
    font-size: 100px;
    background-color: grey;
    color: white;
    border: none;
    cursor: pointer;
    
    border-radius: 25px;
}
.circle_btn:hover {
    transition: all 3s;
    transform: rotate(360deg);
    background-color: yellow;
}

입니다.

다음에는 세부페이지를 구성해보겠습니다. 감사합니다.