Solved

Cut text with white-space:nowrap;

Posted on 2008-11-02
2
910 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
Comment Utility
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
Comment Utility
Perfect, works fine!
Thanks
0

Featured Post

6 Surprising Benefits of Threat Intelligence

All sorts of threat intelligence is available on the web. Intelligence you can learn from, and use to anticipate and prepare for future attacks.

Join & Write a Comment

Unordered lists (HTML ul tags) are very handy to create menus of all types, shapes and sizes.  All it takes is a little knowledge of CSS and the possibilities are endless. First off, you should know the general format for menus created using the …
CSS is a visual language used to classify objects and define rules about how they should be displayed. CSS skills aren’t restricted to developers anymore, there is a big benefit to having a basic understanding of the language, regardless of your occ…
In this tutorial viewers will learn how to define a gradient in CSS. Create a new HTML document with an internal stylesheet.: Create a div in CSS and name it Gradient. Define the background as "linear-gradient(to right, #ee3668, black)". Ensure you …
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…

763 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

7 Experts available now in Live!

Get 1:1 Help Now