欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页

CSS三角练习

程序员文章站 2022-05-26 22:22:33
...
  <!DOCTYPE html>
  <html lang="en">
  <head>
      <meta charset="UTF-8">
      <meta name="viewport" content="width=device-width, initial-scale=1.0">
      <title>CSS三角练习</title>
      <style>
        
        .box2{
          position: relative;
          left:100px;
          
          width: 200px;
          height: 200px;
          background-color:pink;
          margin:100px auto;
          
        }
        .box2 span{
          position:absolute;
          right: 5px;
          top:-20px;
          width:0;
          height:0;
          line-height:0;
          font-size: 0;
          border: 10px solid transparent;
          border-bottom-color: pink;
        }
        
      </style>
  </head>
  <body>
  
    <div class="box2"><span></span></div>
     
     
  </body>
  </html>

CSS三角练习

相关标签: 笔记