Bootstrap工具提示箭头样式

时间:2018-06-06 19:01:10

标签: html css twitter-bootstrap css3

我想自定义引导工具提示。我已经为工具提示的主体制作了必要的样式,但无法弄清楚如何设置箭头样式如下。

Link to the Image

Bootply link

这是我到目前为止所遇到的

.tooltip>.tooltip-inner {
background-color: $tool-tip;
color: $text-color;
border: 2px solid $tool-tip-border;
font-weight: 300;
font-size: 14px;
border-radius: 10px;
padding: 15px 25px;
max-width: 240px;
}

.tooltip.bottom >.tooltip-arrow {
top: 0;
left: 50%;
margin-left: -5px;
border-bottom-color: #000000;
border-width: 0 5px 5px;
}

1 个答案:

答案 0 :(得分:1)



$("[data-toggle=tooltip]").tooltip({trigger:"click"});

<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.1.1/css/bootstrap.min.css" integrity="sha384-WskhaSGFgHYWDcbwN70/dfYBj47jz9qbsMId/iRN3ewGhXQFZCSftd1LZCfmhktB" crossorigin="anonymous">
<style>
body {
  background: red;
}

.tooltip >.tooltip-inner {
    background-color: #000;
    color: #fff;
    border: 2px solid #efefef;
    font-weight: 300;
    font-size: 14px;
    border-radius: 10px;
    padding: 15px 25px;
    max-width: 240px;
}

.tooltip .arrow:before {
    top: -3px;
    left: -12px;
    border-bottom-color: #ffffff;
    border-width: 0 12px 12px;
    z-index: -1;
}

.tooltip .arrow {
    top: 3px;
    left: 50%;
    border-style: solid;
    border-color: transparent transparent #000000 transparent;
    border-width: 0 10px 10px;
}
</style>

<div id="custom-css">
  <a href="#" data-toggle="tooltip" title="Hello world">Click to see my tooltip</a>
</div>

<script src="https://code.jquery.com/jquery-3.3.1.slim.min.js" integrity="sha384-q8i/X+965DzO0rT7abK41JStQIAqVgRVzpbzo5smXKp4YfRvH+8abtTE1Pi6jizo" crossorigin="anonymous"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.14.3/umd/popper.min.js" integrity="sha384-ZMP7rVo3mIykV+2+9J3UJ46jBk0WLaUAdn689aCwoqbBJiSnjAK/l8WvCWPIPm49" crossorigin="anonymous"></script>
<script src="https://stackpath.bootstrapcdn.com/bootstrap/4.1.1/js/bootstrap.min.js" integrity="sha384-smHYKdLADwkXOn1EmN1qk/HfnUcbVRZyYmZ4qpPea6sjB/pTJ0euyQp0Mk8ck+5T" crossorigin="anonymous"></script>
&#13;
&#13;
&#13;