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

【CSS】单元素实现边框内圆角

程序员文章站 2022-06-15 13:39:37
...

通过outline,box-shadow实现单元素内圆角。

<div class="contaniner">
  <p>Lorem ipsum dolor sit amet consectetur adipisicing elit. Unde placeat, repudiandae dolore amet praesentium, fuga a eos id, provident deleniti minima sequi voluptates rem. Sint, nesciunt? Rerum eligendi repudiandae explicabo.</p>
</div>
.contaniner {
  display:flex;
  justify-content:center;
  align-items:center;
  margin:100px auto;
  padding:20px 10px;
  width:400px;
  height:150px;
  background:tan;
  border-radius:20px;
  outline:10px solid pink;
  box-shadow:0 0 0 10px pink
}

演示地址

相关标签: css