Solved

Cut text with white-space:nowrap;

Posted on 2008-11-02
2
919 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
CSS SASS 4 55
Media Queries  not Firing 6 31
really easy css change help please 4 46
boostsrap 1 35
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…
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 to position items using CSS's three positioning types Create a new HTML document with an internal stylesheet.: Create another div in CSS and name it Absolute : Type "position:absolute;" and "top:10px; left:50p…
In this tutorial viewers will learn how to style rounded corners for elements in CSS using the border-radius property Begin with a normal styled element such as a div: To style all four corners of the div to be the same degree of roundness, use the …

710 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