Bootstrap工具提示箭头样式 [英] Bootstrap tooltip arrow style

查看:68
本文介绍了Bootstrap工具提示箭头样式的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想自定义引导工具提示.我已经对工具提示的主体进行了必要的样式设置,但是无法弄清楚如何对箭头样式进行如下设置.

I want to customize the bootstrap tooltip. I have made the necessary styles to the body of the tooltip however can't figure out how to style the arrow as below.

链接到图像

引导链接

这是我到目前为止遇到的

This is what I have came across so far

.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;
}

推荐答案

$("[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>

这篇关于Bootstrap工具提示箭头样式的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆