동적 UI 만드는법

블루밍구
|2023. 2. 16. 13:18
반응형
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Document</title>
<link rel="stylesheet" href="1-2.css">
</head>
<body>
<div class="alert-box" id="alert">알림창임
<button onclick="document.getElementById('alert').style.display = 'none';">닫기</button>
</div>
<button onclick="document.getElementById('alert').style.display = 'block';">버튼</button>

</body>
</html>
.alert-box{
    background-color: skyblue;
    padding: 20px;
    color: white;
    border-radius:5px;
    display: none;
}

 

반응형