Go Premium for a chance to win a PS4. Enter to Win

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 923
  • Last Modified:

Cut text with white-space:nowrap;

Hi,

Is it possible to cut text. Have a look at my code and see if you understand the issue.
I want the text to cut after ..two lines!, thats about 480px with my font.

Is this possilbe at all in html?

Rgds
Cynkan

<div style="position:absolute; left:0px; top:150px; width:480px; white-space:nowrap; ">I am a long line that not should be broken on two lines! I should not be wrapped! I should be cut at 480px.</div>

Open in new window

0
cynkan
Asked:
cynkan
1 Solution
 
trevorpeacockCommented:
try:
overflow:hidden;
<div style="position:absolute; left:0px; top:150px; width:480px; white-space:nowrap; overflow:hidden;">I am a long line that not should be broken on two lines! I should not be wrapped! I should be cut at 480px.</div>

Open in new window

0
 
cynkanAuthor Commented:
Perfect, works fine!
Thanks
0

Featured Post

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now