Solved

Cut text with white-space:nowrap;

Posted on 2008-11-02
2
917 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

ScreenConnect 6.0 Free Trial

Explore all the enhancements in one game-changing release, ScreenConnect 6.0, based on partner feedback. New features include a redesigned UI, app configurations and chat acknowledgement to improve customer engagement!

Question has a verified solution.

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

Suggested Solutions

Introduction If you're like most people, you have occasionally made a typographical error when you're entering information into an online form.  And to your consternation, the browser remembers the error, and offers to autocomplete your future entr…
This article demonstrates how to create a simple responsive confirmation dialog with Ok and Cancel buttons using HTML, CSS, jQuery and Promises
In this tutorial viewers will learn how to style a decorative dropcap for the first letter in a paragraph using CSS. In CSS, create a new paragraph class by typing "p.fancy": Then, to style only the first letter of the first sentence, include the ps…
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…

809 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