473,399 Members | 2,146 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,399 software developers and data experts.

line wrap indent with CSS

We've got some plain text in a DB that we're pulling out and putting it
on our website.

The problem is it has some lists like this:

1. This text goes on and on forever and eventually
it wraps to the next line.

What I want to do is force that 2nd (and any other lines below it) to
wrap like this:

1. This text goes on and on forever and eventually
it wraps to the next line.

I tried text-indent but that does the first line. I can't really do a
negative value there since that puts the first line somewhere it
doesn't belong.

Does anyone have some suggestions for doing this?

Thanks in advance.

Jan 26 '07 #1
5 22318
Rik
<ji*********@gmail.comwrote:
We've got some plain text in a DB that we're pulling out and putting it
on our website.

The problem is it has some lists like this:

1. This text goes on and on forever and eventually
it wraps to the next line.

What I want to do is force that 2nd (and any other lines below it) to
wrap like this:

1. This text goes on and on forever and eventually
it wraps to the next line.

I tried text-indent but that does the first line. I can't really do a
negative value there since that puts the first line somewhere it
doesn't belong.

Does anyone have some suggestions for doing this?
I'd write a server side script which replaces the plaintext with real <ol>
& <litags, after which it's a piece of cake.
--
Rik Wasmus
Jan 26 '07 #2
On 2007-01-26, ji*********@gmail.com <ji*********@gmail.comwrote:
We've got some plain text in a DB that we're pulling out and putting it
on our website.

The problem is it has some lists like this:

1. This text goes on and on forever and eventually
it wraps to the next line.

What I want to do is force that 2nd (and any other lines below it) to
wrap like this:

1. This text goes on and on forever and eventually
it wraps to the next line.

I tried text-indent but that does the first line. I can't really do a
negative value there since that puts the first line somewhere it
doesn't belong.

Does anyone have some suggestions for doing this?

Thanks in advance.
You can put a float in the <li>, with width and height set on it, but
various aspects of this approach are a bit tricky.

This came up recently. See

http://tinyurl.com/2xlfcu

or

http://groups.google.co.uk/group/com...12fe377b1427b8
Jan 26 '07 #3
ji*********@gmail.com wrote:
What I want to do is force that 2nd (and any other lines below it) to
wrap like this:

1. This text goes on and on forever and eventually
it wraps to the next line.

I tried text-indent but that does the first line. I can't really do a
negative value there since that puts the first line somewhere it
doesn't belong.
First, give the negative margin some way to fit on the page.
<div style="margin-left: 5em;">

<p style="text-indent: -3em;">
Volutpat duis minim tation eum molestie dolor ea ut. Te dolor wisi.
Accumsan eum et consectetuer illum eu exerci nisl in euismod vulputate.
Nulla duis, in vulputate, minim odio ad, qui diam nulla at qui. Esse
quis laoreet sed, ut feugait molestie consequat iusto, in nostrud zzril
tincidunt consequat et zzril feugait ullamcorper erat euismod.
</p>

</div>
Then close the div.

--
-bts
-Motorcycles defy gravity; cars just suck
Jan 26 '07 #4
On Jan 26, 11:37 am, "Beauregard T. Shagnasty"
<a.nony.m...@example.invalidwrote:
jistanid...@gmail.com wrote:
What I want to do is force that 2nd (and any other lines below it) to
wraplike this:
1. This text goes on and on forever and eventually
it wraps to the nextline.
I tried text-indent but that does the firstline. I can't really do a
negative value there since that puts the firstlinesomewhere it
doesn't belong.First, give the negative margin some way to fit on the page.
<div style="margin-left: 5em;">

<p style="text-indent: -3em;">
Volutpat duis minim tation eum molestie dolor ea ut. Te dolor wisi.
Accumsan eum et consectetuer illum eu exerci nisl in euismod vulputate.
Nulla duis, in vulputate, minim odio ad, qui diam nulla at qui. Esse
quis laoreet sed, ut feugait molestie consequat iusto, in nostrud zzril
tincidunt consequat et zzril feugait ullamcorper erat euismod.
</p>

</div>
Then close the div.
Thanks! This works perfectly!
--
-bts
-Motorcycles defy gravity; cars just suck
Jan 27 '07 #5
ji*********@gmail.com wrote:
Thanks! This works perfectly!
Glad it worked for you. I've used that style on a few pages in the past.

--
-bts
-Motorcycles defy gravity; cars just suck
Jan 27 '07 #6

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Simon Wigzell | last post by:
I'm generating HTML formatted emails in my asp program using CDONT. Depending on hoow ling the link is it will sometimes wrap and ruin the link. The is Detail email properties listing : ...
8
by: Peter Hoyle | last post by:
I'm trying to generate a tabbed menu system that will wrap to the next line when necessary. I tried using the css shown on this website http://www.sitepoint.com/print/accessible-menu-tabs It...
1
by: Simon Wigzell | last post by:
I send HTML formatted emails with links and images in them generated by my asp driven website. Occasionally the image will not appear and the link will not work. By looking at the email at the...
10
by: Michael | last post by:
I am having a hard time trying to find out how to stop windows from line wrapping using the curses library. Does anyone know how? Thanks, Michael
3
by: mg | last post by:
How can I get a long Label1.Text to wrap within a WebForm (C#)?
2
by: zeyais | last post by:
Here is my HTML: <style> ..leftcolumn{float:left;width:300px;border: 1px solid #ccc} ..rtcolumn{float:left;width:600px;border: 1px solid #ccc} </style> <body> <div class="leftcolumn"...
0
by: pa.singer | last post by:
Does anyone know how I can calculate if a line that is about to print during the PrintPage event of the PrintDocument is too long for the page? I know the margins and the page width, and I've...
5
by: Jason | last post by:
I have a div box with a border, and some padding left and right. It has some text with different font sizes, and a few icons. I want to cut off any overflow at the end of the line with "...",...
0
by: inetlab | last post by:
Hello How I can wrap down the long text to the new line in the standart TreeView for WinWorms? Or where I can find another treeview control which support this feature?
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.