HTML提示框编写

目录

效果展示

一、CSS代码展示

 二、HTML代码展示

三、完整代码展示


效果展示

一、CSS代码展示

<style >
        .box{
            width: 400px;
            height: 300px;
        }
        .top{
            width: 100%;
            height: 15%;
            background-color: rgb(198, 241, 241);

            align-items: center; /* 文字居中对齐 */
            display: flex;
            justify-content:space-between;

            border-radius: 10px 10px 0 0;/*圆角设置左上,右上,右下,左下*/
        }
        .title{
            width: 100px;
            text-align: center;
        }
        .quit{
            text-align: center;
            width: 50px;
        }
        .middle{
            width: 100%;
            height: 70%;
            background-color: azure;
        }
        .bottom{
            width: 100%;
            height: 15%;
            background-color:rgb(177, 177, 232);
            align-items: center;
            display: flex;
            gap: 1%; /*每个盒子之间的间距*/
            margin-left: auto;
            justify-content: end; /*调整元素在盒子中的排列组合方式*/

            border-radius: 0 0 10px 10px;/*圆角设置左上,右上,右下,左下*/
        }

        .but{
            height: 70%;
            width: 18%;
            border-radius: 10px;/*边框圆角*/
            margin-right: 1%;/*调整对齐间距*/
            
	        background-color:#f66f6a;
	        color:white;
	        border:0;
	        font-size: 13px;
	        box-sizing: content-box;				
        }
        .but:hover{/*事件,将鼠标悬停在标签上,改变颜色*/
	        background-color: #a54b4a;
        }
        .X{
            margin-right: 2%;/*边框圆角*/
            border: 0;
            background-color: transparent/*将button标签背景色改为透明*/
        }
        .X:hover{/*事件,将鼠标悬停在标签上,改变颜色*/
            color: #f66f6a;
        }

    </style>

 二、HTML代码展示

<body>
    <div class="box">
        <div class="top">
            <p class="title">显示标题</p>
            <button class="X">X</button>
        </div>

        <div class="middle">
            
        </div>

        <div class="bottom">
            <button class="but no">关闭</button>
            <button class="but yes">确认</button>
        </div>
    </div>
</body>

三、完整代码展示

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style >
        .box{
            width: 400px;
            height: 300px;
        }
        .top{
            width: 100%;
            height: 15%;
            background-color: rgb(198, 241, 241);

            align-items: center; /* 文字居中对齐 */
            display: flex;
            justify-content:space-between;

            border-radius: 10px 10px 0 0;/*圆角设置左上,右上,右下,左下*/
        }
        .title{
            width: 100px;
            text-align: center;
        }
        .quit{
            text-align: center;
            width: 50px;
        }
        .middle{
            width: 100%;
            height: 70%;
            background-color: azure;
        }
        .bottom{
            width: 100%;
            height: 15%;
            background-color:rgb(177, 177, 232);
            align-items: center;
            display: flex;
            gap: 1%; /*每个盒子之间的间距*/
            margin-left: auto;
            justify-content: end; /*调整元素在盒子中的排列组合方式*/

            border-radius: 0 0 10px 10px;/*圆角设置左上,右上,右下,左下*/
        }

        .but{
            height: 70%;
            width: 18%;
            border-radius: 10px;/*边框圆角*/
            margin-right: 1%;/*调整对齐间距*/
            
	        background-color:#f66f6a;
	        color:white;
	        border:0;
	        font-size: 13px;
	        box-sizing: content-box;				
        }
        .but:hover{/*事件,将鼠标悬停在标签上,改变颜色*/
	        background-color: #a54b4a;
        }
        .X{
            margin-right: 2%;/*边框圆角*/
            border: 0;
            background-color: transparent/*将button标签背景色改为透明*/
        }
        .X:hover{/*事件,将鼠标悬停在标签上,改变颜色*/
            color: #f66f6a;
        }

    </style>
</head>
<body>
    <div class="box">
        <div class="top">
            <p class="title">显示标题</p>
            <button class="X">X</button>
        </div>

        <div class="middle">
            
        </div>

        <div class="bottom">
            <button class="but no">关闭</button>
            <button class="but yes">确认</button>
        </div>
    </div>
</body>
</html>

评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

□_□□_□

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值