css - Overflowing text in hidden speech bubbles -


i having trouble overflowing text in hidden speech bubble: demo

the text inside hidden speech bubble over-flows repeated text 'hidden message here' , stay confined area inside box.

how change code shows of type stays inside area of speech bubble?

demo

html:

<div id="container"><a href="#" class="hoverbubble">hover on me!<span><p>hidden message here. hidden message here. hidden message here. hidden message here. hidden message here.hidden message here.hidden message here.</p></span></a></div> 

css:

#container { background-color: #ff0; margin: 200px; float: left; height: 200px; width: 200px; text-align: center; font-family: arial, helvetica, sans-serif; font-size: 16px; position: relative; } a.hoverbubble { text-decoration: none; } a.hoverbubble span { display: none; position: absolute; left: 3%; top: 40%; } a.hoverbubble:hover span { display: block; position: absolute; padding: .5em; content: attr(title); min-width: px; text-align: center; width: 180px; height: 100px; white-space: nowrap; top: -125px; 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: 6.1em; } 

you need remove white-space: nowrap a.hoverbubble span

a.hoverbubble:hover span {     white-space: nowrap; } 

this prevents text wrapping when reaches confines of container.


Comments

Popular posts from this blog

apache - Remove .php and add trailing slash in url using htaccess not loading css -

javascript - jQuery show full size image on click -