Solved

Almost too easy...

Posted on 1998-12-05
10
209 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
Don't Cry: How Liquid Web is Ensuring Security

WannaCry is just the start. Read how Liquid Web is protecting itself and its customers against new threats.

 

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

Building a website can seem like a daunting task to the uninitiated but it really only requires knowledge of two basic languages: HTML and CSS.
When crafting your “Why Us” page, there are a plethora of pitfalls to avoid. Follow these five tips, and you’ll be well on your way to creating an effective page.
In this tutorial viewers will learn how to style a corner ribbon overlay for an image using CSS Create a new class by typing ".Ribbon":  Define the class' "display:" as "inline-block": Define its "position:" as "relative": Define its "overflow:" as …
In this tutorial viewers will learn how to embed an audio file in a webpage using HTML5. Ensure your DOCTYPE declaration is set to HTML5: : The declaration should display (CODE) HTML5 is supported by the most recent versions of all major browsers…

623 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