请问下这种css样式如何写?

image.png

左下角和右上角的样式怎么写呢?

阅读 4.1k
4 个回答

image.png

<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
  <style>
    .outside-circle {
      width: 100px;
      position: relative;
      background: #e91e63;
      border-radius: 10px 0px 10px 0px;

    }

    .outside-circle::before {
      content: "";
      position: absolute;
      width: 20px;
      height: 20px;
      left: 0px;
      transform: rotate(180deg);
      bottom: -20px;
      background: #000;
      background: radial-gradient(circle at 0 0, transparent 20px, #e91e63 21px);
    }

    .outside-circle::after {
      content: "";
      position: absolute;
      width: 20px;
      transform: rotate(90deg);
      height: 20px;
      right: -20px;
      top: 0;
      background: #000;
      background: radial-gradient(circle at 100% 0, transparent 20px, #e91e63 21px);
    }
  </style>
</head>

<body>
  <div class="outside-circle">outside-circle</div>
</body>

</html>

https://jsrun.net/BddKp/edit

<div class="test test1"></div>
<div class="test test2"></div>
<div class="test test3"></div>
<div class="test test4"></div>
<style>
.test {
    width: 20px;
    height: 20px;
    background: #000;
    margin: 10px;
}
.test1 {
    background: radial-gradient(circle at 0 0,transparent 20px,#e91e63 21px);
}
.test2 {
    background: radial-gradient(circle at 0 100%,transparent 20px,#e91e63 21px);
}
.test3 {
    background: radial-gradient(circle at 100% 0,transparent 20px,#e91e63 21px);
}
.test4 {
    background: radial-gradient(circle at 100% 100%,transparent 20px,#e91e63 21px);
}
</style>
新手上路,请多包涵

SELECT SQL_CALC_FOUND_ROWS * from user; SELECT FOUND_ROWS()

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