css画一个提示框
程序员文章站
2023-10-17 23:51:38
用css画一个如下图的提示框: 代码如下: ......
用css画一个如下图的提示框:
代码如下:
<!doctype html> <html lang="en"> <head> <meta charset="utf-8"> <title>title</title> <style> .dialog{ display:inline-block; padding:10px; border-radius: 4px; z-index: 2000; font-size: 12px; border:1px solid #303133; position: relative; top: 30px; left:50px; } .dialog .dialog_ico{ position: relative; top: -31px; } .dialog_ico:after,.dialog_ico:before{ content:''; display:block; position:absolute; border-style:solid; border-width:10px; } .dialog_ico:before{ border-color:black transparent transparent transparent; left:20px; top:42px; } .dialog_ico:after{ border-color:#fff transparent transparent transparent; left:20px; top:41px; } </style> </head> <body> <div class="dialog"> <span class="dialog_text">这是提示框</span> <div class="dialog_ico"></div> </div> </body> </html>