Css:使用css创建走投无路的边框

时间:2015-11-02 05:51:13

标签: html css twitter-bootstrap css-shapes

我要创建你在附图中看到的东西

enter image description here

现在我正在使用它作为背景图像

background-image: url("corner.png");
background-size: cover;

然后添加了文字,但我知道确实存在用于创建此边框的css解决方案,所以如果有人请帮助我,我试图找到但我找不到合适的解决方案

3 个答案:

答案 0 :(得分:3)

您也可以从以下链接生成并使用它。

http://apps.eky.hk/css-triangle-generator/

.arrow {
  width: 250px;
  height: 60px;
  position: relative;
  background: #333;
}
.arrow:after {
  content: '';
  width: 0;
  height: 0;
  border-left: 15px solid transparent;
  border-right: 15px solid transparent;
  border-top: 15px solid #333;
  position: absolute;
  bottom: -15px;
  left:25px;
}
<div class="arrow"></div>

答案 1 :(得分:1)

&#13;
&#13;
.arrow-down {
  width: 200px;
  height: 50px;
  position: relative;
  background: red;
}
.arrow-down:after {
  content: '';
  width: 0;
  height: 0;
  border-left: 20px solid transparent;
  border-right: 20px solid transparent;
  border-top: 20px solid #f00;
  position: absolute;
  bottom: -19px;
}
&#13;
<div class='arrow-down'>fgdfgdfgfd</div>
&#13;
&#13;
&#13;

这会对你有所帮助。 它将使用css创建箭头。

  

https://css-tricks.com/snippets/css/css-triangle/

答案 2 :(得分:1)

选中此fiddle希望您提及类似的内容。

a.tooltips {
  position: relative;
  display: inline;
}
a.tooltips span {
  position: absolute;
  width:140px;
  color: #FFFFFF;
  background: #000000;
  height: 30px;
  line-height: 30px;
  text-align: center;
  visibility: hidden;
  border-radius: 6px;
}
a.tooltips span:after {
  content: '';
  position: absolute;
  top: 100%;
  left: 50%;
  margin-left: -8px;
  width: 0; height: 0;
  border-top: 8px solid #000000;
  border-right: 8px solid transparent;
  border-left: 8px solid transparent;
}
a:hover.tooltips span {
  visibility: visible;
  opacity: 0.8;
  bottom: 30px;
  left: 50%;
  margin-left: -76px;
  z-index: 999;
}
相关问题