Click to See Complete Forum and Search --> : How to stop word wrap inside div


captainash
06-24-2009, 05:36 PM
Hi

I'm using a series of divs to display "username - email address" with an Ajax 'autocomplete' function. There's not too many users, so I don't need to see the entire email address, but I can't stop the div from word-wrapping and hiding the longer email addresses.

I hope that makes sense. This seems like the simplest thing, but I can't stop word wrapping. If I use "overflow: hidden" the email address is still wrapped, but then hidden.

<html>

<style type="text/css">

.pulldown {
font-size: 14px;
width: 300px;
padding: 2px;
height: 22px;
background-color: #EEEEEE;
}

</style>

<div class="pulldown">
FirstName Surname - thisismyreallylongemailaddressthatIwanttostayononelineinsteadofwrapping@mail.com</div>

</html>

Any help most appreciated! Thanks.

captainash
06-25-2009, 05:15 PM
Anyone?

It's got to be possible ... surely? :(

hsbsitez
07-13-2009, 02:23 AM
try white-space: nowrap;

captainash
07-14-2009, 07:17 PM
SWEET!!

white-space: nowrap;
overflow: hidden;

Did the job perfectly. Thanks hsbsitez, exactly what I needed :cool: