Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsGeneralPHPASPPerlColdFusionFlashHTML, CSS, ScriptsBrowsers

Webmaster Forum / HTML, CSS, Scripts / CSS / November 2003



Tip: Looking for answers? Try searching our database.

Indent paragraph except for first line?

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Firas - 28 Nov 2003 21:01 GMT
Hi,

Is there a CSSish way to indent a paragraph except for the first line?

I tried

p:first-line {
    text-indent: 0em;
}

p {
    margin-left: 3em;
}

But it didn't work in IE6 or Firebird. Is it supposed to work in theory?

This is the page I'm working on:

http://s88900951.onlinehome.us/scrapbook/text/shakespeare/shakespeare.html
Evertjan. - 28 Nov 2003 21:05 GMT
Firas wrote on 28 nov 2003 in comp.infosystems.www.authoring.stylesheets:

> p:first-line {
>      text-indent: 0em;
[quoted text clipped - 3 lines]
>      margin-left: 3em;
>}

p                {margin-left: 3em;}
p:first-line    {margin-left: 0em;}

Signature

Evertjan.
The Netherlands.
(Please change the x'es to dots in my emailaddress)

Evertjan. - 28 Nov 2003 21:08 GMT
Evertjan. wrote on 28 nov 2003 in
comp.infosystems.www.authoring.stylesheets:

> p                   {margin-left: 3em;}
> p:first-line    {margin-left: 0em;}

Sorry, I pressed "send" bedfore I finished testing.

This does not work.

Signature

Evertjan.
The Netherlands.
(Please change the x'es to dots in my emailaddress)

Evertjan. - 28 Nov 2003 21:11 GMT
Evertjan. wrote on 28 nov 2003 in
comp.infosystems.www.authoring.stylesheets:

> Evertjan. wrote on 28 nov 2003 in
> comp.infosystems.www.authoring.stylesheets:
[quoted text clipped - 5 lines]
>
> This does not work.

But this does:

<style>
p    {margin-left: 3em;text-indent: -3em;}
</style>

Signature

Evertjan.
The Netherlands.
(Please change the x'es to dots in my emailaddress)

Jukka K. Korpela - 28 Nov 2003 22:16 GMT
>> p                   {margin-left: 3em;}
>> p:first-line    {margin-left: 0em;}
>
> Sorry, I pressed "send" bedfore I finished testing.

> This does not work.

Right, or at least it should not work, since by the CSS specification,
there is just a small collection of properties that apply to
a :first-line pseudo-element, and margin properties aren't among them.

So the use of the text-indent property for p, as discussed elsewhere in
the thread, is the right way.

Signature

Yucca, http://www.cs.tut.fi/~jkorpela/

JustAnotherGuy - 28 Nov 2003 21:11 GMT
> Firas wrote on 28 nov 2003 in comp.infosystems.www.authoring.stylesheets:
>
[quoted text clipped - 8 lines]
> p                {margin-left: 3em;}
> p:first-line    {margin-left: 0em;}

Yeah, typing error, the above is what I meant I tried :)
Stan Brown - 29 Nov 2003 15:18 GMT
In article <b31d075b.0311281301.60e93c83@posting.google.com> in
comp.infosystems.www.authoring.stylesheets, Firas
<firas_posting@hotmail.com> wrote:
>Is there a CSSish way to indent a paragraph except for the first line?
>
[quoted text clipped - 7 lines]
>    margin-left: 3em;
>}

Too elaborate. "text-indent" _is_ a first-line property, so for a
hanging indent do

p { margin-left: 3em; text-indent:-3em }

Signature

Stan Brown, Oak Road Systems, Cortland County, New York, USA
                                 http://OakRoadSystems.com/
HTML 4.01 spec: http://www.w3.org/TR/html401/
validator:      http://validator.w3.org/
CSS 2 spec:     http://www.w3.org/TR/REC-CSS2/
  2.1 changes: http://www.w3.org/TR/CSS21/changes.html
validator:      http://jigsaw.w3.org/css-validator/

 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2009 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.