css实现四角边框

html:

复制代码
   <div
            class="box"
            v-for="(item, index) in coldBaseInfo.stationModelList"
            :key="index"
          >
            <div class="boxleft">
              <img :src="photo[index]" alt="Image" />
            </div>

vue2:

复制代码
  photo: [
        require("@/assets/img/bigscreen/two.jpg"),
        require("@/assets/img/bigscreen/four.png"),
        require("@/assets/img/bigscreen/five.jpg"),
        require("@/assets/img/bigscreen/ten.jpg"),
      ],

css:

复制代码
.boxleft {
  
  background: linear-gradient(to left, #04C886, #04C886) left top no-repeat,
        linear-gradient(to bottom, #04C886, #04C886) left top no-repeat,
        linear-gradient(to left, #04C886, #04C886) right top no-repeat,
        linear-gradient(to bottom, #04C886, #04C886) right top no-repeat,
        linear-gradient(to left, #04C886, #04C886) left bottom no-repeat,
        linear-gradient(to bottom, #04C886, #04C886) left bottom no-repeat,
        linear-gradient(to left, #04C886, #04C886) right bottom no-repeat,
        linear-gradient(to left, #04C886, #04C886) right bottom no-repeat;
    background-size: 2px 10px, 10px 2px, 2px 10px, 10px 2px;
  img {
    width: 100%;
    height: 100%;
    padding: 4px;
    border: 2px solid #7fb1c580;
  } 
 
}
相关推荐
charlie114514191几秒前
CSS学习笔记3:颜色、字体与文本属性基础
css·笔记·学习·教程·基础
一 乐7 分钟前
二手车销售|汽车销售|基于SprinBoot+vue的二手车交易系统(源码+数据库+文档)
java·前端·数据库·vue.js·后端·汽车
Giant10013 分钟前
如果要做优化,CSS提高性能的方法有哪些?
前端
dllxhcjla15 分钟前
html初学
前端·javascript·html
只会写Bug的程序员16 分钟前
【职业方向】2026小目标,从web开发转型web3开发【一】
前端·web3
LBuffer18 分钟前
破解入门学习笔记题二十五
服务器·前端·microsoft
kuxku21 分钟前
使用 SSE 与 Streamdown 实现 Markdown 流式渲染
前端·javascript·node.js
Sherry00732 分钟前
【译】🔥如何居中一个 Div?看这篇就够了
前端·css·面试
前端小咸鱼一条33 分钟前
18. React的受控和非受控组件
前端·react.js·前端框架
一枚前端小能手38 分钟前
🛠️ Service Worker API深度解析 - 生命周期、缓存与离线实战
前端·javascript