我建立我的第一個網站,我有一些隱藏的講話氣泡出現,當你將鼠標懸停在圖片喜歡這張demo如何定位隱藏的對話氣泡
但是我不知道怎麼影響的定位測量結果講話泡泡,我怎麼能讓講話泡泡在盒子的中心對齊呢?
任何幫助將不勝感激!
HTML:
<div id="container"><a href="#" class="hoverbubble">Hover over me!<span>Hidden message here.</span></a></div>
CSS:
#container {
background-color: #FF0;
margin: 100px;
float: left;
height: 200px;
width: 200px;
text-align: center;
font-family: Arial, Helvetica, sans-serif;
font-size: 16px;
}
a.hoverbubble {
position: relative;
text-decoration: none;
}
a.hoverbubble span {display: none;
}
a.hoverbubble:hover span {
display: block;
position: absolute;
padding: .5em;
content: attr(title);
min-width: px;
text-align: center;
width: auto;
height: auto;
white-space: nowrap;
top: -40px;
background: rgba(0,0,0,.8);
-moz-border-radius: 10px;
-webkit-border-radius: 10px;
border-radius: 10px;
color: #fff;
font-size: 0.86em;
font-family: Arial, Helvetica, sans-serif;
}
a.hoverbubble:hover span:after {
position: absolute;
display: block;
content: "";
border-color: rgba(0,0,0,.8) transparent transparent transparent;
border-style: solid;
border-width: 10px;
height: 0;
width: 0;
position: absolute;
bottom: -20px;
left: 1em;
}
作品謝謝! :D – user3466579
我會如何影響固定高度的語音氣泡,文字流過? – user3466579
你能給我一個這個問題的jsfiddle,我會看看?可能'溢出:隱藏'可能有幫助? – Scott