Solved

Almost too easy...

Posted on 1998-12-05
10
171 Views
Last Modified: 2010-04-09
How can I decrease the spacing between the lines generated by <p>?  I have something like

<p>Test line 1</p>
<p>Test 2</p>
<p>Three</p>

I want to decrease the spacing between the lines.  How can I do that?

Thanks
0
Comment
Question by:p021497
  • 3
  • 3
  • 2
  • +2
10 Comments
 
LVL 4

Expert Comment

by:martinag
ID: 1840225
<BR>Test line 1
<BR>Test 2
<BR>Three

<P> is equal to <BR><BR>

Martin
0
 
LVL 4

Accepted Solution

by:
rafistern earned 20 total points
ID: 1840226
With style sheets:

<style>
p {margin-top:0.5em;}
</style>

equivalent to

<p style="margin-top:0.5em;">

would reduce the spacing to half a letter height. (This will only work on NS4+ and IE3+)

0
 
LVL 84

Expert Comment

by:ozo
ID: 1840227
or:

<p>Test line 1<font size=-4> </p>
<p> </font>Test 2<font size=-4>.</p>
<p></font>Three</p>
0
 

Author Comment

by:p021497
ID: 1840228
rafistern, can you please provide a brief example as to how to implement your solution?  I am rather confused.
0
 
LVL 4

Expert Comment

by:martinag
ID: 1840229
Put this between <HEAD> and </HEAD>:
<style>
<!--
  p {margin-top:0.5em;}
// -->
</style>

That'll change all <p>'s in your document. If you just want to change a few, use this:
<p style="margin-top:0.5em;">
instead of just <p>

Martin
0
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 

Expert Comment

by:hualing
ID: 1840230
Please try this :


<html>
<head>
      <title>Untitled</title>
      </head>

<body>

That'll change all
<p style="margin-top:2em;">'s in your document. If you just want to change a few, use this:
<p style="margin-top:0.6em;">
instead of just
<p style="margin-top:0.1em;">
look this one

</body>
</html>

Hualing
0
 
LVL 4

Expert Comment

by:rafistern
ID: 1840231
That's right, do what they said. Sorry I didn't get back to you but it was the middle of the night over here.
0
 

Author Comment

by:p021497
ID: 1840232
I have it working now.  But is there any way I can decrease the spacing even more?  I tried this:
<p style="margin-top:0.0001em;">

but that is not enough!  Can I decrease spacing even more?  I will post separate questions for everyone who contributed.
0
 
LVL 4

Expert Comment

by:martinag
ID: 1840233
I don't know much about this, but you could try using "0em" and if that isn't enough, try negative values, ie. "-1em".

Martin
0
 

Author Comment

by:p021497
ID: 1840234
After further experimentation, I have found that -0.9999 works very well.  I have accepted rafistern's answer and have posted two more 25 point questions for Martin and Hualing.
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Things That Drive Us Nuts Have you noticed the use of the reCaptcha feature at EE and other web sites?  It wants you to read and retype something that looks like this.Insanity!  It's not EE's fault - that's just the way reCaptcha works.  But it is …
This article describes how to create custom column layout styles for Bootstrap. The article uses 5 columns to illustrate the concept, but the principle can be extended to any number of columns.
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…
HTML5 has deprecated a few of the older ways of showing media as well as offering up a new way to create games and animations. Audio, video, and canvas are just a few of the adjustments made between XHTML and HTML5. As we learned in our last micr…

929 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

9 Experts available now in Live!

Get 1:1 Help Now