473,498 Members | 1,842 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

negative indent for paragraph

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
xa*@xahlee.org
∑ http://xahlee.org/

Aug 30 '05 #1
2 3987
Els
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 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.

--
Els http://locusmeus.com/
Sonhos vem. Sonhos vão. O resto é imperfeito.
- Renato Russo -
Now playing: Flash And The Pan - Midnight Man
Aug 30 '05 #2
Els
Els wrote:
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

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

--
Els http://locusmeus.com/
Sonhos vem. Sonhos vão. O resto é imperfeito.
- Renato Russo -
Now playing: Falco - Jeanny
Aug 30 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

10
2971
by: KathyB | last post by:
Hi, I just can't get this quite right. I use the following function to validate a user entry. I need to allow negative numbers including those with decimals (e.g., -.5). The following allows the...
21
10900
by: Wladimir Borsov | last post by:
Assume I want to publish a longer article on a web page. One of the paragraphs I want to display with an indent. Read: All text lines of this paragraph should be displayed with (let's say 8) blanks...
1
5839
by: Vincent | last post by:
I noticed an irritating behaviour of the text-indent property and I wonder if I'm the only one to feel this way about it: it seems that text-indent applies even to floated elements. Although this...
6
2107
by: Michael Hughes | last post by:
Hi All, I'm building another site, trying to uses as few tables as I can. I've hit a bit of a snag, which is that on this design:- http://www.mfhughes.com/ktest/deutsch.htm If you look on...
22
27210
by: Firas | last post by:
Hi, Is there a CSSish way to indent a paragraph except for the first line? I tried p:first-line { text-indent: 0em; }
35
4507
by: Martin Wells | last post by:
Plain char may be signed or unsigned. Typical ranges could be: CHAR_MIN == -128, CHAR_MAX == 127 CHAR_MIN == 0, CHAR_MAX == 255 The Standard says that the behaviour is undefined if we...
1
3773
by: Daniel Jung | last post by:
Hi Please take a look at http://lingo.uib.no/daniel/testcase5/ where I made a (surprising) testcase (and a screenshot), involving padding-left and negative text-indent on option elements (right...
14
2285
by: Jeff | last post by:
Lets say we have a paragraph that wraps several lines. I'd like to indent the first-line a bit. The first-line pseudo class sprang to mind, but you can't set a left padding there. Perhaps...
0
7168
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
7210
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
6891
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
7381
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
1
4916
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
4595
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
3096
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
1424
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
1
659
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.