Solved

Indent all but first line

Posted on 2002-05-03
6
373 Views
Last Modified: 2008-03-17
Is it possible to indent all but the first line using CSS in a SPAN?  It would look somewhat like a list, but not bulleted.  For example, I want it to look something like this:

Line 1
   Line 2
   Line 3
   Line 4

Thanks
0
Comment
Question by:ten_spoons
[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
6 Comments
 
LVL 53

Expert Comment

by:COBOLdinosaur
ID: 6989101
Yes, but not with a span.  it can only be applied the block elements.  works bes with the p tag:

<p> first line of text</p>
<p style="text-indent:10px">
the rest of the stuff goes here
</p>
You cannot use a br tag within the indented text, that will end indentation

The problem with it is that yu ge and extra line feed between the pargraphs.
If you don't want that you can try it with a span this way this way:
<p>first line here<br/>
<span style="padding-left:10px">
all the rest of the stuff here
</span></p>

The problem with the second method is that it is unreliable for Netscrap 4, and some version of Opera
Cd&
0
 
LVL 51

Expert Comment

by:ahoffmann
ID: 6989172
<head><style TYPE="text/css"> p:first-line  {margin-left:-20px;} p {margin-left:50px;} </style></head>
<body><p>line 1<br>line 2<br>line 3<br></p></body>
0
 
LVL 53

Expert Comment

by:COBOLdinosaur
ID: 6989310
Yes first-line will work but only for ie5.5+, Netscrap6, and I think probably Opera.

Cd&
0
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 51

Expert Comment

by:ahoffmann
ID: 6989587
well, when talking about CSS, I'd use NS6, Opera 4.x, 5.x, 6.x, and probably IE6.x, (not shure about amaya, mozilla and Konqueror 3.x) Anything else is wasting time ...
(Cd&, think you already know this, 'cause I've seen you posting this sevaral time:-)
0
 
LVL 2

Accepted Solution

by:
TenTonJim earned 100 total points
ID: 6991474
p
{
margin-left:5px;
text-indent:-5px;
}
0
 

Author Comment

by:ten_spoons
ID: 6994752
Thank you everybody for the suggestions.  TenTonJim's just worked best for the situation.
0

Featured Post

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
push Book Today button to right 10 102
Internet Explorer View > Style menu 3 33
CSS Odd/Even Confusion 2 40
Best explanation of following code css 11 40
Creating a CSS block that only applies to printing By default, all of your CSS applies to every possible view of your page - whether on screen, printed, landscape, touch-screen, or whatever.  You can, however, add CSS that only applies under certai…
This article demonstrates how to create a simple responsive confirmation dialog with Ok and Cancel buttons using HTML, CSS, jQuery and Promises
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…
In this tutorial viewers will learn how to position overlapping items using z-index in CSS. They will also learn the restrictions on the z-index property.  Create a new HTML document with an internal stylesheet.: Create a div in CSS and name it Red.…

734 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