Solved

indent all but the first line

Posted on 2000-02-22
3
847 Views
Last Modified: 2008-02-20
I have a span inside a DIV...
(using IE5) when the span wraps inside the DIV, i'd like to indent those lines that wrapped.  Not the first lines.. only all lines that have wrapped.
thanks so much...

jack
0
Comment
Question by:hjack
  • 2
3 Comments
 
LVL 7

Expert Comment

by:nettrom
ID: 2545458
I'm not exactly sure how this would be most correctly solved, but I have a possible solution.  the logic goes:

1: add the desired indentation as a left padding of the DIV (space between the DIV's border and the content)
2: pull the first line back the same amount as the padding.

ideally I'd like to use the pseudo-class 'first-line' to solve it, but it's not supported by IE5 (I'm not sure if it's any better either).  I used 'text-indent' instead.  according to the CSS2 spec it's perfectly legal.  worked OK in Netscape 4 and IE5, didn't work in IE4 and Opera.

example uses a 25px indentation:

<div style="padding-left:25px;">
<span style="text-indent:-25px;">
"Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diem nonummy nibh euismod tincidunt ut lacreet dolore magna aliguam erat volutpat.Ut wisis enim ad minim veniam, quis nostrud exerci tution ullamcorper suscipit lobortis nisl ut aliquip ex ea commodo consequat. Duis te feugifacilisi."
</span>
</div>

the indentation can be set using any legal CSS value (percentage, pixels, em, ex, points, etc), only remember to have the same amount in both places and the text-indent should be a negative value.  otherwise you'll probably not get the effect you want.
0
 
LVL 28

Accepted Solution

by:
sybe earned 200 total points
ID: 2549944
<html>

<head>
<style type="text/css">
li {list-style : none ; text-align: left; text-indent: -3%}
</style>
</head>
<body>

<li>jygkjgkyj jkgh gf hjkgfhjkg fjhgf jhgfhjg fhjgfj hgfhj gfjhg fjhgfjhg fj lkhjljk lhjkg lhjghjkgkjh jkhgkj gkjhgk jhgkj gkjg ghjk jhg hjk jhg jkgkhjg jygkjgkyj jkgh gf hjkgfhjkg fjhgf jhgfhjg fhjgfj hgfhj gfjhg fjhgfjhg fj lkhjljk lhjkg lhjghjkgkjh jkhgkj gkjhgk jhgkj gkjg ghjk jhg hjk jhg jkgkhjg jygkjgkyj jkgh gf hjkgfhjkg fjhgf jhgfhjg fhjgfj hgfhj gfjhg fjhgfjhg fj lkhjljk lhjkg lhjghjkgkjh jkhgkj gkjhgk jhgkj gkjg ghjk jhg hjk jhg jkgkhjg jygkjgkyj jkgh gf hjkgfhjkg fjhgf jhgfhjg fhjgfj hgfhj gfjhg fjhgfjhg fj lkhjljk lhjkg lhjghjkgkjh jkhgkj gkjhgk jhgkj gkjg ghjk jhg hjk jhg jkgkhjg jygkjgkyj jkgh gf hjkgfhjkg fjhgf jhgfhjg
<li>jygkjgkyj jkgh gf hjkgfhjkg fjhgf jhgfhjg fhjgfj hgfhj gfjhg fjhgfjhg fj lkhjljk lhjkg lhjghjkgkjh jkhgkj gkjhgk jhgkj gkjg ghjk jhg hjk jhg jkgkhjg jygkjgkyj jkgh gf hjkgfhjkg fjhgf jhgfhjg fhjgfj hgfhj gfjhg fjhgfjhg fj lkhjljk lhjkg lhjghjkgkjh jkhgkj gkjhgk jhgkj gkjg ghjk jhg hjk jhg jkgkhjg jygkjgkyj jkgh gf hjkgfhjkg fjhgf jhgfhjg fhjgfj hgfhj gfjhg fjhgfjhg fj lkhjljk lhjkg lhjghjkgkjh jkhgkj gkjhgk jhgkj gkjg ghjk jhg hjk jhg jkgkhjg jygkjgkyj jkgh gf hjkgfhjkg fjhgf jhgfhjg fhjgfj hgfhj gfjhg fjhgfjhg fj lkhjljk lhjkg lhjghjkgkjh jkhgkj gkjhgk jhgkj gkjg ghjk jhg hjk jhg jkgkhjg jygkjgkyj jkgh gf hjkgfhjkg fjhgf jhgfhjg
</body>
0
 
LVL 7

Expert Comment

by:nettrom
ID: 2574218
hjack, you still with us?
0

Featured Post

ScreenConnect 6.0 Free Trial

At ScreenConnect, partner feedback doesn't fall on deaf ears. We collected partner suggestions off of their virtual wish list and transformed them into one game-changing release: ScreenConnect 6.0. Explore all of the extras and enhancements for yourself!

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Why is this panel heading creating extra space 2 52
Javasctipt 2 27
AdminLTE with wordpress 15 66
Call a function within the ASP code 4 12
Someone recently asked me about how to display a progress indicator on a page while an iframe is loading. And I remember when I first came across this myself. It was a bit tricky to get my head around, but really, it's very simple. The most impor…
Not sure what the best email signature size is? Are you worried about email signature image size? Follow this best practice guide.
The viewer will receive an overview of the basics of CSS showing inline styles. In the head tags set up your style tags: (CODE) Reference the nav tag and set your properties.: (CODE) Set the reference for the UL element and styles for it to ensu…
HTML5 has deprecated a few of the older ways of showing media as well as offering up a new way to create games and animations. Audio, video, and canvas are just a few of the adjustments made between XHTML and HTML5. As we learned in our last micr…

831 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