Re: negative indent for paragraph
- From: Els <els.aNOSPAM@xxxxxxxxxx>
- Date: Tue, 30 Aug 2005 20:32:07 +0200
Xah Lee wrote:
> is there a way to do negative indent for paragraphs, as in a dialogues?
> (i.e. in Microsoft word, drag the top margin triangle to the left,
> bottom to the right, then press tab after each person's name)
>
> here's a rather a hack after some 20 minutes diddling.
I've never tried to do something like that, but it looks like a decent
method to me. Have you tried it cross browser?
> <style type="text/css">
> p.dg {margin-top:5px; margin-bottom:5px;}
> </style>
>
> <div style="background-color:yellow; padding:1ex;">
> <div style="text-indent:-7ex; margin-left:7ex;">
> <p class="dg">Ursula: Have we got a deal?</p>
> <p class="dg">Ariel: If I become human, I'll never be with my father or
> sisters again.</p>
> <p class="dg">Ursula: But you'll have your man. Life's full of tough
> choices, isn't? Oh — and there is one more thing. We haven't
> discussed the subject of payment.</p>
> <p class="dg">Ariel: But I don't have any —</p>
> <p class="dg">Ursula: I'm not asking much. Just a token, really, a
> trifle. What I want from you is... your voice.</p>
> <p class="dg">Ariel: But without my voice, how can I —</p>
> <p class="dg">Ursula: You'll have your looks! Your pretty face! And
> don't underestimate the importance of body language! Ha!</p>
> </div>
> </div>
There is no need for those classes on the <p> elements.
Just transfer that inline style to the style***, using a class, and
refer to the p elements thus:
div.dg{text-indent:-7ex; margin-left:7ex;}
div.dg p{margin-top:5px; margin-bottom:5px;}
A lot less code if you have many of those dialogues too.
--
Els http://locusmeus.com/
Sonhos vem. Sonhos vão. O resto é imperfeito.
- Renato Russo -
Now playing: Flash And The Pan - Midnight Man
.
- Follow-Ups:
- Re: negative indent for paragraph
- From: Els
- Re: negative indent for paragraph
- References:
- negative indent for paragraph
- From: Xah Lee
- negative indent for paragraph
- Prev by Date: negative indent for paragraph
- Next by Date: Re: negative indent for paragraph
- Previous by thread: negative indent for paragraph
- Next by thread: Re: negative indent for paragraph
- Index(es):