老师麻烦看一下对不对?
来源:2-12 自由编程
一心励志当码农
2021-07-22 10:14:09
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>
<style>
* {
padding: 0;
margin: 0;
}
html,body {
width: 100%;
height: 100%;
}
.bigbox {
width: 100%;
height: 100%;
background-color: rgba(0, 0, 0, 0.6);
}
.inner {
width: 50%;
background-color: white;
border-radius: 10px;
position: absolute;
left: 50%;
top: 50%;
transform: translate(-50%, -50%);
padding: 30px 50px;
}
.text {
text-align: center;
font-size: 20px;
margin-bottom: 50px;
}
.btncontainer {
display: flex;
width: 100%;
height: 50px;
justify-content: center;
align-items: center;
}
.btn {
border: none;
width: 20%;
height: 100%;
border-radius: 10px;
margin-left: 20px;
font-size: 20px;
color: white;
margin-bottom: 20px;
}
.btn-left {
background-color:rgba(0, 140, 255, 0.966);
}
.btn-right {
background-color: gray
}
</style>
</head>
<body>
<div class="bigbox">
<div class="inner">
<p class="text">确认要删除吗?</p>
<div class="btncontainer">
<button class="btn-left btn">确认</button>
<button class=" btn-right btn">取消</button>
</div>
</div>
</div>
</body>
</html>
1回答
同学你好,按钮样式与效果图不太符,建议优化一下,如图
可以参考如下代码修改:
祝学习愉快!
相似问题