html自定义弹窗

<!DOCTYPE html>
<html>
<head> 
<meta charset="utf-8"> 
<title>弹窗</title> 
</head>
<style>
#close:hover
{ 
background-color:#aa1111;
border-color:#aa1111;
}
</style>
<body>
<button onclick='show("demo")'>show</button>
<dialog open id='demo' style='display:none;' draggable="true">
<div style="float:left;font-size:6px;font-weight:bold;">这是一个弹窗</div>
<div style="float:right;border:0px;font-size:6px">
<button id='close' style="height:15px;width:20px;color:#ffffff;border:2px;border-color:#f3f3f3;font-size:5px;border-radius:3px;" onclick="getElementById('demo').setAttribute('style','display:none')">×</button>
</div>  
<div style="clear:both">
<p>弹窗文件测试,小哥哥快来玩啊!</p>
</div>
<div style="float:right;">
<button style="color:#ffffff;background:#aa1111;border:0px;font-size:5px;border-radius:3px;display:inline-block;" onclick="getElementById('demo').setAttribute('style','display:none')">关闭</button>
<button style="color:#ffffff;background:#bebcc3;border:0px;font-size:5px;border-radius:3px;display:inline-block;" onclick="getElementById('demo').setAttribute('style','display:none')">取消</button>
</div>
</dialog>
<script>
function show(id){
document.getElementById(id).setAttribute('style','display:block;padding:2px;border: medium double #bebcc3;border-radius:5px;')
}	
</script>
</body>
</html>

 

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

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

余额充值