目录 需求 直接上代码 效果 自己试一下,把代码复制一下,点运行 需求 在html中,设计一个按钮,点击后会跳出以可消息框,点击其他地方会关闭.常用于网页门户关于我们的使用 直接上代码 <html> <head> <style> /* 定义弹出消息框的样式 */ .overlay { position: fixed; top: 0; left: 0; width: 100%; height: 100%; background-color: rgba(0, 0, 0, 0.7); z-index: 999; display