如何在 css 中创建它?

文森特·杜克罗

我想在 CSS(或引导功能)中创建这种设计,所以如果你知道教程或我需要的东西。

我想创造的风格:

在此处输入图片说明

谢谢

迭戈·N。

您可以使用一些 css 技巧(在 + 定位之后)轻松获得此标签标签:

HTML:

<span class="label-tag">Type</span>

CSS:

.label-tag {
   display:inline-block;
   position: relative;
   height: 20px;
   line-height: 20px;
   padding: 10px 20px;
   color: white;
   background-color: #509e2f;
}

.label-tag:after {
  content: '';
  position: absolute;
  left: 100%;
  top: 0px;
  border-width: 20px 0px 20px 20px;
  border-style: solid;
  border-color: transparent transparent transparent #509e2f;
}

工作小提琴:https : //jsfiddle.net/bd45gynk/

本文收集自互联网,转载请注明来源。

如有侵权,请联系 [email protected] 删除。

编辑于
0

我来说两句

0 条评论
登录 后参与评论

相关文章