2025年4月26日 星期六 乙巳(蛇)年 正月廿七 设为首页 加入收藏
rss
您当前的位置:首页 > 计算机 > 编程开发 > Html+Div+Css(前端)

CSS对话框案例

时间:08-26来源:作者:点击数:24

用到了伪元素before和after

  • <!DOCTYPE html>
  • <html>
  • <head>
  • <meta charset="UTF-8">
  • <title></title>
  • <style type="text/css">
  • *{
  • margin: 0;
  • padding: 0;
  • }
  • html,body{
  • height: 100%;
  • overflow: hidden;
  • }
  • #test{
  • width: 600px;
  • height: 400px;
  • border: 1px solid;
  • border-radius:50%;
  • text-align: center;
  • font: 30px helvetica;
  • line-height: 400px;
  • position: relative;
  • }
  • #test:after{
  • position: absolute;
  • display: block;
  • content: "";
  • width: 80px;
  • height: 80px;
  • border: 1px solid;
  • bottom: -20px;
  • right: -20px;
  • border-radius:50%;
  • }
  • #test:before{
  • position: absolute;
  • display: block;
  • content: "";
  • width: 50px;
  • height: 50px;
  • border: 1px solid;
  • bottom: -100px;
  • right: -100px;
  • border-radius:50%;
  • }
  • </style>
  • </head>
  • <body>
  • <div id="test">大家好,欢迎入坑前端</div>
  • </body>
  • </html>
方便获取更多学习、工作、生活信息请关注本站微信公众号城东书院 微信服务号城东书院 微信订阅号
推荐内容
相关内容
栏目更新
栏目热门