Solved

Almost too easy...

Posted on 1998-12-05
10
164 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
How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

 

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

Top 6 Sources for Identifying Threat Actor TTPs

Understanding your enemy is essential. These six sources will help you identify the most popular threat actor tactics, techniques, and procedures (TTPs).

Join & Write a Comment

Do you want to insert HTML5 video into your site? This is the tutorial how to do so. What are the main advantages of HTML5 video? 1) Have good compression, good image quality, and low decode processor use. 2) It is royalty-free 3) It is easi…
Is your Office 365 signature not working the way you want it to? Are signature updates taking up too much of your time? Let's run through the most common problems that an IT administrator can encounter when dealing with Office 365 email signatures.
In this Micro Tutorial viewers will learn how to create navigation buttons that change on rollover, using CSS (Continuation of the CSS Image Sprite tutorial) Create a parent ID for all the list items       - Specify position: absolute and display: block…
In this tutorial viewers will learn how to position overlapping items using z-index in CSS. They will also learn the restrictions on the z-index property.  Create a new HTML document with an internal stylesheet.: Create a div in CSS and name it Red.…

747 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

10 Experts available now in Live!

Get 1:1 Help Now