so my problem is like this:
I have a div, and in the div I have an img and then a string next to the image, the height is at 25, the width is at 128, and its align to center.
its just a username and a little icon next to their name. it works fine up until the user has a really long name in which case it will put the string onto a new line, which is definitely not what I want.
I would like it to just over flow and hide the rest of the name if it is too long. is there anyway I can do this?
I had overflow hidden as well as max-height and max-width. I tried using a span as well as display:inline but it keeps pushing it to a new line. I need to keep the alignment centered.
any help?
cant seem to find any information. I tried putting it in a table as well but to no avail.
here's the code:
<a href="#" class="tab2">
<table align="center">
<tr>
<td valign="bottom" id="contactLink1">
<div align="center" class="funtion_user_imageloc_box">
<?php if($memimglevelROW['imageloc']!=''){
if ($memimglevelROW['imageloc']=="black1.png"){?>
<img src="levelimage/<?php echo $memimglevelROW['imageloc'];?>" alt="" width="30.5" height="16" align="center" class="funtion_user_img1" />
<?php } else {?>
<img src="levelimage/<?php echo $memimglevelROW['imageloc'];?>" alt="" width="18" height="18" align="center" class="funtion_user_img2" />
<?php }
}
echo $username;?>
</div>
</td>
</tr>
</table>
</a>
Welcome to the community!
You should try white-space: nowrap;
as that will probably fix your problem.
Also, don't ever use tables for non-tabular data. It's not 1995 anymore, CSS can do anything a table can do.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With