Solved

Indent all but first line

Posted on 2002-05-03
6
369 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
6 Comments
 
LVL 53

Expert Comment

by:COBOLdinosaur
Comment Utility
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
Comment Utility
<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
Comment Utility
Yes first-line will work but only for ie5.5+, Netscrap6, and I think probably Opera.

Cd&
0
IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

 
LVL 51

Expert Comment

by:ahoffmann
Comment Utility
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
Comment Utility
p
{
margin-left:5px;
text-indent:-5px;
}
0
 

Author Comment

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

Featured Post

What Is Threat Intelligence?

Threat intelligence is often discussed, but rarely understood. Starting with a precise definition, along with clear business goals, is essential.

Join & Write a Comment

When applying CSS to your HTML, there are many different ways to select which element(s) the CSS applies to.  Some of these selectors are more commonly known and used than others - Here are the more common ones: #X - Matches an ID of X .X - Matche…
As a result of several questions about how to use Bootstrap I thought it would be a good idea to write down the development aspect of creating a Bootstrapped website in as little time as possible. Part 1 of this article will only concentrate on g…
In this tutorial viewers will learn how add a full-size background image to a webpage using CSS3. Create a new HTML document with an internal stylesheet.: In CSS, define the html element to have a background image. Use a high resolution image.: In t…
In this tutorial viewers will learn how to customize the background color and font color of highlighted text using the ::selection element in CSS Begin by defining the selected text as an element in CSS by typing "::selection": Style the ::selection…

763 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

11 Experts available now in Live!

Get 1:1 Help Now