CSS로 경고 메시지를 생성하기 위한 코드는 다음과 같습니다 -
예시
<!DOCTYPE html>
<html>
<head>
<meta name="viewport" content="width=device-width, initial-scale=1">
<style>
body{
font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}
.alertMessage {
padding: 20px;
background-color: #f44336;
color: white;
font-size: 20px;
}
.close{
margin-left: 15px;
color: white;
font-weight: bold;
float: right;
font-size: 22px;
line-height: 20px;
cursor: pointer;
transition: 0.3s;
}
.close:hover {
color: black;
}
</style>
</head>
<body>
<h1>Alert Message Example</h1>
<div class="alertMessage">
<span class="close" onclick="this.parentElement.style.display='none';">×</span>
<strong>This cannot be revered!</strong> You account will be deleted.
</div>
</body>
</html> 출력
위의 코드는 다음과 같은 출력을 생성합니다 -
