Solved

indent all but the first line

Posted on 2000-02-22
3
823 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
Comment Utility
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
Comment Utility
<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
Comment Utility
hjack, you still with us?
0

Featured Post

Maximize Your Threat Intelligence Reporting

Reporting is one of the most important and least talked about aspects of a world-class threat intelligence program. Here’s how to do it right.

Join & Write a Comment

Suggested Solutions

Foreword (July, 2015) Since I first wrote this article, years ago, a great many more people have begun using the internet.  They are coming online from every part of the globe, learning, reading, shopping and spending money at an ever-increasing ra…
Building a website can seem like a daunting task to the uninitiated but it really only requires knowledge of two basic languages: HTML and CSS.
The viewer will the learn the benefit of plain text editors and code an HTML5 based template for use in further tutorials.
The viewer will learn how to create a basic form using some HTML5 and PHP for later processing. Set up your basic HTML file. Open your form tag and set the method and action attributes.: (CODE) Set up your first few inputs one for the name and …

743 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

18 Experts available now in Live!

Get 1:1 Help Now