Solved

indent all but the first line

Posted on 2000-02-22
3
851 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
[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
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

Enroll in May's Course of the Month

May’s Course of the Month is now available! Experts Exchange’s Premium Members and Team Accounts have access to a complimentary course each month as part of their membership—an extra way to increase training and boost professional development.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Embedding Tags in a restricted UI 6 59
Use Mid in Html 6 35
Link Anchor Not working 9 67
close pop up windows when logout or main window closes 17 86
This article explains how to prepare an HTML email signature template file containing dynamic placeholders for users' Azure AD data. Furthermore, it explains how to use this file to remotely set up a department-wide email signature policy in Office …
Find out what you should include to make the best professional email signature for your organization.
In this tutorial viewers will learn how add a scalable full-width header using CSS3. Create a new HTML document with an internal stylesheet. Set a tiled background.:  Create a new div and name it Header. Position it with position:absolute at the top…
In this tutorial viewers will learn how to embed an audio file in a webpage using HTML5. Ensure your DOCTYPE declaration is set to HTML5: : The declaration should display (CODE) HTML5 is supported by the most recent versions of all major browsers…

738 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