Solved

Almost too easy...

Posted on 1998-12-05
10
204 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 

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
 

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

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Suggested Solutions

This article demonstrates how to create a simple responsive confirmation dialog with Ok and Cancel buttons using HTML, CSS, jQuery and Promises
The article shows the basic steps of integrating an HTML theme template into an ASP.NET MVC project
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ā€¦
The viewer will the learn the benefit of plain text editors and code an HTML5 based template for use in further tutorials.

734 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