Solved

Cut text with white-space:nowrap;

Posted on 2008-11-02
2
912 Views
Last Modified: 2012-05-05
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
Comment
Question by:cynkan
2 Comments
 
LVL 1

Accepted Solution

by:
trevorpeacock earned 125 total points
ID: 22861363
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
 

Author Comment

by:cynkan
ID: 22861581
Perfect, works fine!
Thanks
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

As a result of several questions about how to use Bootstrap I thought it would be a good idea to write down the development aspect of creating a Bootstrapped website in as little time as possible. Part 1 of this article will only concentrate on g…
Browsers only know CSS so your awesome SASS code needs to be translated into normal CSS. Here I'll try to explain what you should aim for in order to take full advantage of SASS.
In this tutorial viewers will learn how add a scalable full-width header using CSS3. Create a new HTML document with an internal stylesheet. Set a tiled background.:  Create a new div and name it Header. Position it with position:absolute at the top…
In this tutorial viewers will learn how to embed custom externally-hosted Google Fonts using the Google Font API in CSS Go to the Google Fonts website at google.com/fonts: Browse or search based on font properties or name to find a suitable font for…

911 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

23 Experts available now in Live!

Get 1:1 Help Now