4 个回答
css
 .rect {
      position: absolute;
      top: 20px;
      left: 20px;
      width: 100px;
      height: 100px;
      text-align: center;
      line-height: 100px;
      background: linear-gradient(to left, #f00, #f00) left top no-repeat,
        linear-gradient(to bottom, #f00, #f00) left top no-repeat,
        linear-gradient(to left, #f00, #f00) right top no-repeat,
        linear-gradient(to bottom, #f00, #f00) right top no-repeat,
        linear-gradient(to left, #f00, #f00) left bottom no-repeat,
        linear-gradient(to bottom, #f00, #f00) left bottom no-repeat,
        linear-gradient(to left, #f00, #f00) right bottom no-repeat,
        linear-gradient(to left, #f00, #f00) right bottom no-repeat;
      background-size: 1px 20px, 20px 1px, 1px 20px, 20px 1px;
    }
    
html
  <div class="rect">游戏首页</div>

这个用CSS写的话成本比较大,可以让你们设计给你个图片替代。

比如你定义四个span,然后使用定位,再设置它们的边框显示

撰写回答
你尚未登录,登录后可以
  • 和开发者交流问题的细节
  • 关注并接收问题和回答的更新提醒
  • 参与内容的编辑和改进,让解决方法与时俱进
推荐问题