好!欢迎访问迷津渡口 现在时间是: 天气 °C ~ °C

迷津渡口

越感到迷惑 越接近真理

纯CSS实现自定义工具提示

所谓工具提示是指鼠标悬停在具有title属性的元素上时一些浏览器弹出的小文本框。

精通CSS里面介绍了一种纯CSS实现的工具提示,小指感觉很有意思,摘出来与诸君共享。

这里利用的是CSS的定位技术:

<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Example for tooltip</title>
<style type="text/css">
a.tooltip {
position: relative;
}
a.tooltip span {
display: none;
}
a.tooltip:hover span {
display: block;
position: absolute;
top: 1em;
left: 2em;
padding: 0.2em 0.6em;
border: 1px solid #996633;
background-color: #FFFF66;
color: #000;
white-space: nowrap;
}
</style>
</head>
<body>
<p>
<a href="http://www.qingzz.cn/"class="tooltip">www.qingzz.cn<span>(A wonderful website for you!)</span></a> is a website powered by emlog.
</p>
</body>
</html>

其中主要是设置父元素position:relative;从而可以使工具提示根据父元素定位。需要使用的自己美化吧~

点赞1
 标签: css css工具提示
   支持一下
挤眼 亲亲 咆哮 开心 想想 可怜 糗大了 委屈 哈哈 小声点 右哼哼 左哼哼 疑问 坏笑 赚钱啦 悲伤 耍酷 勾引 厉害 握手 耶 嘻嘻 害羞 鼓掌 馋嘴 抓狂 抱抱 围观 威武 给力
 点赞
 签到
 表情
 图片
 代码
提交评论

清空信息
关闭评论
hurizmir
 hurizmir 56 分钟前回复
#131
<a href="http://www.rcrocs.com/femmes-nike-cortez-jaune-violet-chaussuresl">femmes nike cortez jaune violet</a> <a href="http://www.moreheaddotts.com/tout-blanc-adidas-cleats-soccer-chaussuresl">tout blanc adidas cleats soccer</a> <a href="http://www.qgchsmrt.com/air-jordan-retro-4-wei%C3%9F-blau-grau-leopard-schuhej">air jordan retro 4 wei脽 blau grau leopard</a> <a href="http://www.firagandia.com/nike-lunarepic-flyknit-rot-schuhei">nike lunarepic flyknit rot</a> <a href="http://www.lmladeco.com/nike-tiempo-legend-v-sg-pro-svart-obuvj">nike tiempo legend v sg pro svart</a> <a href="http://www.brinkmanmdc.com/adidas-gazelle-bianca-junior-scarpel">adidas gazelle bianca junior</a>
hurizmir http://www.hurizmir.com/
mwartsdrama
 mwartsdrama 约 12 小时前回复
#130
<a href="http://www.theislandbody.com/air-jordan-retro-7-sky-blue-shoesk">air jordan retro 7 sky blue</a> <a href="http://www.zululeads.com/nike-zoom-pegasus-34-kvinners-gr%C3%B8nn-hvit-obuvq">nike zoom pegasus 34 kvinners gr酶nn hvit</a> <a href="http://www.notmyrichie.com/kvinders-nike-flyknit-lunar-1-gul-guld-skoj">kvinders nike flyknit lunar 1 gul guld</a> <a href="http://www.mintyschoice.com/nike-kobe-10-oro-blu-scarpeq">nike kobe 10 oro blu</a> <a href="http://www.mamapjblog.com/womens-nike-air-max-tailwind-5-pink-black-shoesj">womens nike air max tailwind 5 pink black</a> <a href="http://www.pdfunicorn.com/nike-zoom-pegasus-33-herre-lilla-skop">nike zoom pegasus 33 herre lilla</a>
mwartsdrama http://www.mwartsdrama.com/
minstrelhouse
 minstrelhouse 约 15 小时前回复
#129
<a href="http://www.jazzoutlaw.com/adidas-john-wtout-1-tout-star-roster-butyd">adidas john wtout 1 tout star roster</a> <a href="http://www.fifteenforty.com/adidas-zx-flux-dust-rosado-blanco-kurpesc">adidas zx flux dust rosado blanco</a> <a href="http://www.cagiad.com/air-jordan-13-retro-noir-rouge-blanc-schuhea">air jordan 13 retro noir rouge blanc</a> <a href="http://www.magicwristlet.com/nike-air-huarache-triple-nero-amsterdam-kurpesf">nike air huarache triple nero amsterdam</a> <a href="http://www.fleksys.com/kobe-7-lila-and-gold-chaussuresa">kobe 7 lila and gold</a> <a href="http://www.teamworkpress.com/air-jordan-5-rosa-bl%C3%A5-kurpesg">air jordan 5 rosa bl氓</a>
minstrelhouse http://www.minstrelhouse.com/
mndrsngh
 mndrsngh 2019-03-20 15:02回复
#128
<a href="http://www.claudefremont.com/herren-asics-asics-gel-kayano-17-wei%C3%9F-orange-schuheb">herren asics asics gel kayano 17 wei脽 orange</a> <a href="http://www.jlredcross.com/nike-black-ryan-kalil-name-number-logo-nfl-67-carolina-panthers-pullover-hoodie-nflr">nike black ryan kalil name number logo nfl 67 carolina panthers pullover hoodie</a> <a href="http://www.maracamp.com/nike-womens-ryan-jensen-game-black-jersey-tampa-bay-buccaneers-nfl-66-fashion-nflx">nike womens ryan jensen game black jersey tampa bay buccaneers nfl 66 fashion</a> <a href="http://www.neveudigital.com/asics-gel-kinsei-2-herre-sko-kit-schuheg">asics gel kinsei 2 herre sko kit</a> <a href="http://www.obervall.com/air-jordan-retro-5-v-fire-rouge-scarpeg">air jordan retro 5 v fire rouge</a> <a href="http://www.twiggyallure.com/maschio-salomon-speed-cross-3-viola-verde-kurpesf">maschio salomon speed cross 3 viola verde</a>
mndrsngh http://www.mndrsngh.com/
bucketgrills
 bucketgrills 2019-03-20 01:31回复
#127
<a href="http://www.maxfullforce.com/nike-free-6.0-orange-vert-obuvb">nike free 6.0 orange vert</a> <a href="http://www.myserafins.com/nike-free-5.0-v4-kvinders-lyser%C3%B8d-butya">nike free 5.0 v4 kvinders lyser酶d</a> <a href="http://www.robineliza.com/harrison-smith-jersey-ebay-nflu">harrison smith jersey ebay</a> <a href="http://www.tainostudios.com/nike-n7-zoom-kd-iv-schuhe-kurpesb">nike n7 zoom kd iv schuhe</a> <a href="http://www.caberrals.com/kvinners-nike-air-max-87-sb-gr%C3%A5-hvit-schuhed">kvinners nike air max 87 sb gr氓 hvit</a> <a href="http://www.cinselpaketin.com/adidas-rose-7-oro-rosado-schuheg">adidas rose 7 oro rosado</a>
bucketgrills http://www.bucketgrills.com/
zotorrent
 zotorrent 2019-03-19 22:04回复
#126
<a href="http://www.tmzred.com/michael-kors-handbag-bedford-ostrich-tote-mkh">michael kors handbag bedford ostrich tote</a> <a href="http://www.alcovozov.com/nike-lebron-soldier-10-gul-gr%C3%B8nn-obuvi">nike lebron soldier 10 gul gr酶nn</a> <a href="http://www.ahmztradefx.com/femminile-nike-kd-8-arancia-bianca-scarpej">femminile nike kd 8 arancia bianca</a> <a href="http://www.isampled.com/mens-asics-gel-quantum-360-pink-sky-blue-shoesh">mens asics gel quantum 360 pink sky blue</a> <a href="http://www.aldervets.com/kyrie-1-verde-glow-zapatosk">kyrie 1 verde glow</a> <a href="http://www.vanltl.com/adidas-zx-900-plata-rosado-zapatosp">adidas zx 900 plata rosado</a>
zotorrent http://www.zotorrent.com/
saatchixblog
 saatchixblog 2019-03-19 06:56回复
#125
<a href="http://www.kideschool.com/air-jordan-29-hvid-trim-schuheg">air jordan 29 hvid trim</a> <a href="http://www.killersandbox.com/jordan-6-negro-infrarojo-rosado-schuhec">jordan 6 negro infrarojo rosado</a> <a href="http://www.mymascensores.com/aidas-boost-clima-chill-sort---bl%C3%A5-chaussurese">aidas boost clima chill sort   bl氓</a> <a href="http://www.paypalwar.com/jordan-4-legend-bleu-raffle-butyg">jordan 4 legend bleu raffle</a> <a href="http://www.bamoments.com/lebron-12-orange-and-bleu-karaoke-scarpea">lebron 12 orange and bleu karaoke</a> <a href="http://www.fintecsales.com/nike-free-3.0-venta-dahombres-schuheb">nike free 3.0 venta dahombres</a>
saatchixblog http://www.saatchixblog.com/
pubgdust
 pubgdust 2019-03-18 02:15回复
#124
<a href="http://www.michiganev.com/milwaukee-brewers-new-era-mlb-black-heather-59fifty-cap-hatj">milwaukee brewers new era mlb black heather 59fifty cap</a> <a href="http://www.serdarhan.com/nike-air-force-1-blu-rosso-bianca-scarpej">nike air force 1 blu rosso bianca</a> <a href="http://www.ankaralimnet.com/nike-air-max-bw-ultra-blau-schuhei">nike air max bw ultra blau</a> <a href="http://www.greenwichua.com/converse-high-tops-dark-gr%C3%B8n-skoh">converse high tops dark gr酶n</a> <a href="http://www.minicomposer.com/womens-nike-baltimore-ravens-5-game-pink-new-be-luvd-nfl-jersey-nfli">womens nike baltimore ravens 5 game pink new be luvd nfl jersey</a> <a href="http://www.tabletopsport.com/nike-free-run-3.0-v4-menn-r%C3%B8d-gr%C3%A5-obuvk">nike free run 3.0 v4 menn r酶d gr氓</a>
pubgdust http://www.pubgdust.com/
equacart
 equacart 2019-03-17 03:53回复
#123
<a href="http://www.ddspcollege.com/nike-zoom-winflo-3-marron-blanc-scarped">nike zoom winflo 3 marron blanc</a> <a href="http://www.durulcamdag.com/air-jordan-post-game-zapatos-schuhea">air jordan post game zapatos</a> <a href="http://www.fantasynz.com/nike-air-max-95-cuir-rose-noir-kurpesb">nike air max 95 cuir rose noir</a> <a href="http://www.fresnotrip.com/nike-mercurialx-finale-arancia-viola-schuhee">nike mercurialx finale arancia viola</a> <a href="http://www.acincon.com/adidas-porsche-design-hommes-chaussures-butyd">adidas porsche design hommes chaussures</a> <a href="http://www.ayersrockapi.com/nike-roshe-run-team-r%C3%B8d-australia-obuvc">nike roshe run team r酶d australia</a>
equacart http://www.equacart.com/
justadrink
 justadrink 2019-03-17 03:02回复
#122
<a href="http://www.abetterwaymotors.net/jordan-13-hyper-lyser%C3%B8d-7y-for-salg-schuhea">jordan 13 hyper lyser酶d 7y for salg</a> <a href="http://www.accessabath.net/nike-lunarglide-5-kvinners-sports-direct-kurpese">nike lunarglide 5 kvinners sports direct</a> <a href="http://www.acostadesign.net/herre-nike-air-max-bw-alle-lilla-chaussuresa">herre nike air max bw alle lilla</a> <a href="http://www.agentorangelegacy.net/air-jordan-13-retro-nero-and-bianca-kit-kurpesg">air jordan 13 retro nero and bianca kit</a> <a href="http://www.aikenfamilypharmacy.net/nike-air-max-tailwind-7-vente-craigslist-schuhee">nike air max tailwind 7 vente craigslist</a> <a href="http://www.ajimi.net/nike-flyknit-air-max-noir-sail-orange-volt-obuvg">nike flyknit air max noir sail orange volt</a>
[url=http://www.justadrink.net/]justadrink[/url]
顶部留言底部
 00:00/00:00
我想和你虚度时光 - 花房姑娘(9)
  1. 我想和你虚度时光
  2. 花房姑娘
  3. 恋恋风尘
  4. 我喜爱一切不彻底的事物
  5. 我的心里是满的
  6. Long Way
  7. 给少年的歌
  8. 晴日共剪窗
  9. 天上的月你的脸