最近开发项目,想增加滑动提示文字,类似img alt和i的title,但是效果都不是很理想,当然jq也有,但是用起来比较繁琐,使用不是特别方便

于是在github上看到了一个不错的库:

https://github.com/sevck/microtip

国外写的一个纯css3的tooltips

安装使用很简单:

Installation

via npm

npm install microtip

via yarn

yarn add microtip

via CDN

https://unpkg.com/microtip/microtip.css

direct download

curl -o microtip https://github.com/ghosh/microtip/blob/master/microtip.css

Setup

in PostCSS

@import 'microtip';

in Webpack

import microtip from 'microtip/microtip.css'

in SCSS

@import 'microtip/microtip';

Usage

import:

<link rel="stylesheet" type="text/css" href="css/microtip.css">
<button aria-label="Hey tooltip!" data-microtip-position="up" role="tooltip">

也支持调整显示的位置,滑动出现的时间、字体大小等等

Customization

Microtip uses css variables, which allows you to customize the behavior of the tooltip as per your needs.

Variable Description Default Value
--microtip-transition-duration Specifies the duration of the tootltip transition .18s
--microtip-transition-delay The delay on hover before showing the tooltip 0s
--microtip-transition-easing The easing applied while transitioning the tooltip ease-in-out
--microtip-font-size Sets the font size of the text in tooltip 13px
--microtip-font-weight The font weight of the text in tooltip normal
--microtip-text-transform Controls the casing of the text none

效果:

鼠标移动文字提示,或者重写覆盖样式都是可以的

microtip Tooltip工具提示样式的更多相关文章

  1. Highchart :tooltip工具提示

    Highcharts翻译系列之十六:tooltip工具提示tooltip工具提示 参数 描述 默认值 animation 启用或禁用提示的动画.这对大数据量的图表很有用 true background ...

  2. 如何在 pyqt 中自定义工具提示 ToolTip

    前言 Qt 自带的工具提示样式不太好看,就算加了样式表也时不时会失效,同时工具提示没有阴影,看起来就更难受了.所以本篇博客将会介绍自定义工具提示的方法,效果如下图所示: 实现过程 工具提示其实就是一个 ...

  3. 关于【bootstrap】中,【tooltip】的不算bug的bug的个人看法

    先说下遇到这个问题的背景吧. 就是在页面中有个div,这个div右上角(或者其他位置)有个 × 的图标(这个图标添加tooltip工具提示),光标移到这个图标时,触发tooltip,提示“点击移除”这 ...

  4. 第二百四十五节,Bootstrap标签页和工具提示插件

    Bootstrap标签页和工具提示插件 学习要点: 1.标签页 2.工具提示 本节课我们主要学习一下 Bootstrap 中的标签页和工具提示插件. 一.标签页选项卡 标签页也就是通常所说的选项卡功能 ...

  5. 知问前端——工具提示UI

    工具提示(tooltip),是一个非常实用的UI.它彻底扩展了HTML中的title属性,让提示更加丰富,更加可控制,全面提升了用户体验. 调用tooltip()方法 在调用tooltip()方法之前 ...

  6. Bootstrap 标签页和工具提示插件

    一.标签页 标签页也就是通常所说的选项卡功能. //基本用法 <ul class="nav nav-tabs"> <li class="active&q ...

  7. 扩展ToolBarManager、ListView和Grid控件以实现气球式的ToolTip

    原文:扩展ToolBarManager.ListView和Grid控件以实现气球式的ToolTip infragistics是全球领先的UI工具和用户体验的专家,Infragistics开发了一系列的 ...

  8. Tooltip浮动提示框效果(掌握里面的小知识)

    使用原生JavaScript设计和实现Tooltip浮动提示框特效,了解代码简化.事件绑定.事件冒泡等技巧和知识. 特效四个关键点:显示:鼠标移到ToolTip超链接上时,ToolTip提示框可以显示 ...

  9. QT的hint的toolTip的使用

    QString value = ''1213213231"; this->setToolTip(value);//QT自带的接口 value就是自己想要塞进的数据. 如果字符多的话 怎 ...

随机推荐

  1. Miscosoft Visual Studio项目guid取值

    There isn't an easy way to change the type of a project in Visual Studio project once it is created; ...

  2. Return type declarations返回类型声明

    PHP 7.新增了返回类型声明 http://php.net/manual/en/functions.returning-values.php 在PHP 7.1中新增了返回类型声明为void,以及类型 ...

  3. ss-libev 源码解析udp篇 (2)

    UDP relay的代码基本都在udprelay.c中,无论ss-local还是ss-server的代码都在一起,使用宏MODULE_LOCAL,MODULE_REMOTE等区分开.代码虽然不是很多, ...

  4. web前端开发中的命名规范

      (一)主体 头:header 内容:content/container 尾:footer 导航:nav 侧栏:sidebar 栏目:column 页面外围控制整体布局宽度:wrapper 左右中: ...

  5. onerror="javascript:this.src='images/defaultUpload.png';"【容易导致死循环报错】

    当无法找到默认图片时,onerror="javascript:this.src='images/defaultUpload.png';"容易导致死循环报错

  6. Typescript : 遍历Array的方法:for, forEach, every等

    方法一,for…of 这个貌似是最常用的方法,angular 2中HTML语法绑定也是要的这种语法. let someArray = [1, "string", false]; f ...

  7. POJ2891 Strange Way to Express Integers【扩展中国剩余定理】

    题目大意 就是模板...没啥好说的 思路 因为模数不互质,所以直接中国剩余定理肯定是不对的 然后就考虑怎么合并两个同余方程 \(ans = a_1 + x_1 * m_1 = a_2 + x_2 * ...

  8. MyBatis之一对多映射查询sql配置文件。

    学生---文章的模型一对多模型 学生student.java类 package com.bjsxt.sxf.po; import java.util.Date; import java.util.Li ...

  9. Netflix OSS 和 SpringCloud Netflix简介

    Netflix OSS Netflix是一家互联网流媒体播放商,是美国视频巨头,随着Netflix转型为一家云计算公司,它也开始积极参与开源项目. Netflix OSS(Open Source)就是 ...

  10. mysql 安装(压缩包安装和exe安装)

    1:mysql官网:https://dev.mysql.com/downloads/file/?id=482487 2:压缩包安装:https://www.cnblogs.com/jamespan23 ...