好!欢迎访问迷津渡口 现在时间是: 天气 °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工具提示
   支持一下
挤眼 亲亲 咆哮 开心 想想 可怜 糗大了 委屈 哈哈 小声点 右哼哼 左哼哼 疑问 坏笑 赚钱啦 悲伤 耍酷 勾引 厉害 握手 耶 嘻嘻 害羞 鼓掌 馋嘴 抓狂 抱抱 围观 威武 给力
 点赞
 签到
 表情
 图片
 代码
提交评论

清空信息
关闭评论
rizeingilizce
 rizeingilizce 约 1 小时前回复
#228
<a href="http://www.soextfence.com/nike-tiempo-legend-v-fg-negro-zapatosl">nike tiempo legend v fg negro</a> <a href="http://www.amemedgroup.com/ray-ban-aviator-large-metal-ii-sunglassesh">ray ban aviator large metal ii</a> <a href="http://www.shawkreizer.com/st-louis-cardinals-mesh-hat-hatj">st louis cardinals mesh hat</a> <a href="http://www.powerwomanbc.com/adidas-ultra-boost-uncaged-nero-boost-scarpej">adidas ultra boost uncaged nero boost</a> <a href="http://www.kilaswacana.com/nike-huarache-schwarz-wei%C3%9F-lila-schuhei">nike huarache schwarz wei脽 lila</a> <a href="http://www.hobartcomfest.com/adidas-nmd-runner-triple-hvid-out-skoh">adidas nmd runner triple hvid out</a>
rizeingilizce http://www.rizeingilizce.com/
theweedaddict
 theweedaddict 2019-05-17 15:35回复
#227
<a href="http://www.theislandbody.com/womens-asics-gel-noosa-tri-8-yellow-white-shoesl">womens asics gel noosa tri 8 yellow white</a> <a href="http://www.zululeads.com/new-york-giants-13-jersey-nfli">new york giants 13 jersey</a> <a href="http://www.notmyrichie.com/kvinners-nike-free-tr-rosa-r%C3%B8d-obuvk">kvinners nike free tr rosa r酶d</a> <a href="http://www.mintyschoice.com/coach-female-wallet-coachh">coach female wallet</a> <a href="http://www.mamapjblog.com/nike-zoom-lebron-soldier-vii-deep-royal-blu-scarpei">nike zoom lebron soldier vii deep royal blu</a> <a href="http://www.pdfunicorn.com/nike-kobe-9-bianca-cielo-blu-scarpeh">nike kobe 9 bianca cielo blu</a>
theweedaddict http://www.theweedaddict.com/
cacikvideo
 cacikvideo 2019-05-17 15:35回复
#226
<a href="http://www.ortzproducts.com/nike-roshe-run-high-gr%C3%BCn-gelb-schuhel">nike roshe run high gr眉n gelb</a> <a href="http://www.cooterscamera.com/nike-kobe-9-jaune-gris-chaussuresq">nike kobe 9 jaune gris</a> <a href="http://www.marjalfun.com/air-jordan-retro-3-negro-naranja-zapatosl">air jordan retro 3 negro naranja</a> <a href="http://www.alecsblog.com/kd-9-alle-hvid-skoj">kd 9 alle hvid</a> <a href="http://www.troudumonde.com/adidas-springblade-pro-bl%C3%A5-rosa-obuvi">adidas springblade pro bl氓 rosa</a> <a href="http://www.smilesdrdavid.com/hombres-nike-roshe-yeezy-boost-todas-rojo-zapatosp">hombres nike roshe yeezy boost todas rojo</a>
cacikvideo http://www.cacikvideo.com/
ankarasevgi
 ankarasevgi 2019-05-16 09:48回复
#225
<a href="http://www.alhotelpau.com/hombres-nike-roshe-cool-gris-runningc">hombres nike roshe cool gris</a> <a href="http://www.culective.com/mujer-adidas-zx-630-negro-azul-zapatosj">mujer adidas zx 630 negro azul</a> <a href="http://www.vitaminyemek.com/air-yeezy-ii-2-sp-max-90-infrar%C3%B8d-quarter-chaussuresa">air yeezy ii 2 sp max 90 infrar酶d quarter</a> <a href="http://www.anarevolori.com/air-jordan-1-deep-royal-foota">air jordan 1 deep royal</a> <a href="http://www.antalyairan.com/kobe-5-think-rosado-for-venta-rojodit-runningd">kobe 5 think rosado for venta rojodit</a> <a href="http://www.avonbeads.com/nike-mens-color-rush-2016-minnesota-vikings-stefon-diggs-14-legend-game-jersey-nflh">nike mens color rush 2016 minnesota vikings stefon diggs 14 legend game jersey</a>
ankarasevgi http://www.ankarasevgi.com/
bethelpipe
 bethelpipe 2019-05-15 17:15回复
#224
<a href="http://www.realchiyouth.com/houston-rockets-new-era-nba-enamel-badge-9fifty-snapback-cap-hath">houston rockets new era nba enamel badge 9fifty snapback cap</a> <a href="http://www.djhomeimprove.com/dam%C3%A4nner-air-jordan-12-kaffee-trainersce">dam盲nner air jordan 12 kaffee</a> <a href="http://www.mybigrefund.com/nike-hypervenom-2-schwarz-and-wei%C3%9F-schuhek">nike hypervenom 2 schwarz and wei脽</a> <a href="http://www.gamesiamfree.com/adidas-neo-mesh-nero-rosso-scarpef">adidas neo mesh nero rosso</a> <a href="http://www.cavechezludo.com/nike-air-max-tn-bianca-rosa-kurpesb">nike air max tn bianca rosa</a> <a href="http://www.rxmedsuk.com/nike-cortez-mujeres-p%C3%BArpura-zapatosk">nike cortez mujeres p煤rpura</a>
bethelpipe http://www.bethelpipe.com/
aurorefleurs
 aurorefleurs 2019-05-15 11:12回复
#223
<a href="http://www.cherylblogs.com/hommes-nike-blazer-low-iii-gris-noir-vert-chaussuresl">hommes nike blazer low iii gris noir vert</a> <a href="http://www.livefreshpbc.com/hommes-nike-flyknit-air-vapormax-2018-fluorescent-vert-noir-chaussuresl">hommes nike flyknit air vapormax 2018 fluorescent vert noir</a> <a href="http://www.bacaiptek.com/nike-air-max-90-dark-gr%C3%BCn-schuhej">nike air max 90 dark gr眉n</a> <a href="http://www.socabets.com/air-jordan-8-wei%C3%9F-aqua-schuhei">air jordan 8 wei脽 aqua</a> <a href="http://www.sgeventportal.com/gr%C3%B8nn-high-top-air-force-ones-obuvj">gr酶nn high top air force ones</a> <a href="http://www.isimsizsevda.com/nike-flyknit-trainer-bianca-nero-scarpel">nike flyknit trainer bianca nero</a>
aurorefleurs http://www.aurorefleurs.com/
fishmackerel
 fishmackerel 2019-05-14 11:16回复
#222
<a href="http://www.ortzproducts.com/nike-dunk-plata-negro-zapatosk">nike dunk plata negro</a> <a href="http://www.cooterscamera.com/kvinders-asics-gel-noosa-tri-7-himmelbl%C3%A5-bl%C3%A5-skoi">kvinders asics gel noosa tri 7 himmelbl氓 bl氓</a> <a href="http://www.marjalfun.com/air-yeezy-ii-2-sp-max-90-kvinners-himmelen-bl%C3%A5-hvit-obuvl">air yeezy ii 2 sp max 90 kvinners himmelen bl氓 hvit</a> <a href="http://www.alecsblog.com/nike-roshe-laces-black-shoesh">nike roshe laces black</a> <a href="http://www.troudumonde.com/maschio-nike-roshe-run-rosa-oro-scarpei">maschio nike roshe run rosa oro</a> <a href="http://www.smilesdrdavid.com/kobe-9-rot-high-schuhej">kobe 9 rot high</a>
fishmackerel http://www.fishmackerel.com/
iptvpackage
 iptvpackage 2019-05-14 04:55回复
#221
<a href="http://www.oktoberfestmn.com/fendi-fur-scarf-scarfr">fendi fur scarf</a> <a href="http://www.robotultra.com/bon-march%C3%A9-new-balance-1500-femmes-sneakerc">bon march茅 new balance 1500 femmes</a> <a href="http://www.namboathood.com/nike-lunar-tempo-damen-laufschuh-vegan-shoesa">nike lunar tempo damen laufschuh vegan</a> <a href="http://www.usafitno.com/ray-ban-folding-wayfarer-colors-sunglassesr">ray ban folding wayfarer colors</a> <a href="http://www.faimark.com/ralph-lauren-polo-vintage-clothing-menu-polod">ralph lauren polo vintage clothing menu</a> <a href="http://www.frissedenkers.com/ray-ban-wayfarer-red-sunglassesr">ray ban wayfarer red</a>
[url=http://www.iptvpackage.com/]iptvpackage[/url]
butterbroad
 butterbroad 2019-05-13 17:44回复
#220
<a href="http://www.kaliteankara.com/converse-womens-shoreline-slip-on-white-shoesk">converse womens shoreline slip on white</a> <a href="http://www.bagsbeat.com/nike-indoor-lilac-sort-mercurialx-pro-street-skoj">nike indoor lilac sort mercurialx pro street</a> <a href="http://www.lolalolincoln.com/nike-free-trainer-5.0-herren-blau-wei%C3%9F-schuheh">nike free trainer 5.0 herren blau wei脽</a> <a href="http://www.buycharboleps.com/air-jordan-retro-4-black-dark-bue-grey-shoesk">air jordan retro 4 black dark bue grey</a> <a href="http://www.androidsmith.com/michael-kors-jet-set-tote-white-mkh">michael kors jet set tote white</a> <a href="http://www.oheyewear.com/air-max-90-hyperfuse-svart-and-r%C3%B8d-obuvi">air max 90 hyperfuse svart and r酶d</a>
butterbroad http://www.butterbroad.com/
ishidesign
 ishidesign 2019-05-12 21:53回复
#219
<a href="http://www.clashopedia.com/air-jordan-retro-12-plata-azul-zapatosk">air jordan retro 12 plata azul</a> <a href="http://www.adamomacri.com/womens-north-face-osito-2-jacket-black-northfaceh">womens north face osito 2 jacket black</a> <a href="http://www.waltonranchtx.com/frau-nike-air-max-thea-grau-gr%C3%BCn-schuhek">frau nike air max thea grau gr眉n</a> <a href="http://www.dominickcars.com/nike-shox-sort-s%C3%B8lv-skoi">nike shox sort s酶lv</a> <a href="http://www.libertactica.com/blanc-mettoutic-argent-noir-nike-air-max-tn-femmes-chaussuresh">blanc mettoutic argent noir nike air max tn femmes</a> <a href="http://www.flixzine.com/cincinnati-bearcats-top-of-the-world-kids-booster-2-tone-cap-hatl">cincinnati bearcats top of the world kids booster 2 tone cap</a>
ishidesign http://www.ishidesign.com/
顶部留言底部
 00:00/00:00
我想和你虚度时光 - 花房姑娘(9)
  1. 我想和你虚度时光
  2. 花房姑娘
  3. 恋恋风尘
  4. 我喜爱一切不彻底的事物
  5. 我的心里是满的
  6. Long Way
  7. 给少年的歌
  8. 晴日共剪窗
  9. 天上的月你的脸