使用CSS在设计版面上制作拱形曲线的问题

问题描述 投票:0回答:1

我正在设计卡片,我需要使用css使红色/栗色部分向内弯曲(从黑色部分)。请协助?

HTML标记

 <div class="container phonecard2">
 </div>

<div class="btm-right">
</div>

CSS代码

.container.phonecard2 {
    position: relative;
    background: #000;
    margin-top: 140px;
    width: 35%;
    height: 260px;
    padding: 20px;
    -moz-border-radius:15px;
    -webkit-border-radius:15px;
    border-radius: 15px;
}

.btm-right{
    position: absolute;
    width: 0;
    height: 0;
    bottom: 0;
    right:0;
    border-style: solid;
    border-width: 0 0 160px 450px;
    border-color: transparent transparent #ba0c2f transparent;
}

我的设计的PNG图像在上面的代码PNG image after the CSS code之后

css3 css-transitions user-experience
1个回答
0
投票
<div class="container phonecard2">
  <div class="btm-right"></div>
</div>
<style>
    .container.phonecard2 {
      position: relative;
      background: linear-gradient(to left, #ba0c2f 70%, #000000 30%);
      margin-top: 140px;
      width: 600px;
      height: 260px;
      padding: 20px;
      border-radius: 15px;
      overflow: hidden
    }

    .btm-right {
      position: absolute;
      background: #000;
      width: 800px;
      height: 680px;
      left: -130px;
      top: -330px;
      border-radius: 0 0 580px 0;
      transform: rotate(21deg);
    }
</style>
© www.soinside.com 2019 - 2024. All rights reserved.