简体   繁体   English

创建CSS形状时出现问题

[英]Issue creating CSS shape

I want to create a shape like this but the hollow goes in the bottom. 我想创建这样的形状,但凹陷在底部。 what can I do? 我能做什么?

在此处输入图片说明

  -webkit-box-sizing: content-box;
  -moz-box-sizing: content-box;
  box-sizing: content-box;
  width: 0;
  height: 100px;
  border: 50px solid #1abc9c;
  border-top: 0 solid;
  border-bottom: 35px solid rgba(0,0,0,0);
  font: normal 100%/normal Arial, Helvetica, sans-serif;
  color: rgba(0,0,0,1);
  -o-text-overflow: clip;
  text-overflow: clip;
  -webkit-transition: all 200ms cubic-bezier(0.42, 0, 0.58, 1) 10ms;
  -moz-transition: all 200ms cubic-bezier(0.42, 0, 0.58, 1) 10ms;
  -o-transition: all 200ms cubic-bezier(0.42, 0, 0.58, 1) 10ms;
  transition: all 200ms cubic-bezier(0.42, 0, 0.58, 1) 10ms;
  -webkit-transform:   translateX(21px) ;
  transform:   translateX(21px) ;

make it easy 轻松一点

 .ribbon {
  -webkit-box-sizing: content-box;
  -moz-box-sizing: content-box;
  box-sizing: content-box;
  width: 0;
  height: 100px;
  border: 50px solid #1abc9c;
  border-top: 0 solid;
  border-bottom: 35px solid rgba(0,0,0,0);
  font: normal 100%/normal Arial, Helvetica, sans-serif;
  color: rgba(0,0,0,1);
  -o-text-overflow: clip;
  text-overflow: clip;
}

 .ribbon { -webkit-box-sizing: content-box; -moz-box-sizing: content-box; box-sizing: content-box; width: 0; height: 100px; border: 50px solid #1abc9c; border-top: 0 solid; border-bottom: 35px solid rgba(0,0,0,0); font: normal 100%/normal Arial, Helvetica, sans-serif; color: rgba(0,0,0,1); -o-text-overflow: clip; text-overflow: clip; } 
 <div class="ribbon"></div> 

Few lines of CSS will achieve this 几行CSS可以实现这一目标

 div { display: inline-block; position: relative; height: 0px; width: 0px; border: 25px solid green; border-left: 25px solid transparent; margin-right:75px; } div:after { display: inline-block; position: absolute; top: -25px; content: ''; width: 100px; height: 50px; background-color: green; } 
 <div></div> Some content<br>Something 

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM