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 / August 2005



Tip: Looking for answers? Try searching our database.

negative indent for paragraph

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Xah Lee - 30 Aug 2005 19:18 GMT
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.

<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>

Xah
xah@xahlee.org
=91 http://xahlee.org/
Els - 30 Aug 2005 19:32 GMT
> 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;}
[quoted text clipped - 16 lines]
> </div>
> </div>

There is no need for those classes on the <p> elements.
Just transfer that inline style to the stylesheet, 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.

Signature

Els                     http://locusmeus.com/
Sonhos vem. Sonhos vão. O resto é imperfeito.
                            - Renato Russo -
Now playing: Flash And The Pan - Midnight Man

Els - 30 Aug 2005 19:33 GMT
>> 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,
[quoted text clipped - 28 lines]
> There is no need for those classes on the <p> elements.
> Just transfer that inline style
 *on the div*. that inline style on the containing div I meant :\
> to the stylesheet, 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.

Signature

Els                     http://locusmeus.com/
Sonhos vem. Sonhos vão. O resto é imperfeito.
                            - Renato Russo -
Now playing: Falco - Jeanny

 
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.