By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
440,742 Members | 773 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 440,742 IT Pros & Developers. It's quick & easy.

Space between <p>...</p> and <div>...</div> blocks

P: n/a
I know this must seem totally basic and stupid, but I cannot find any reference that describes how to control the spacing between <p>...</p> and
<div>...</div> blocks. When I implement these on a page, there is a huge gap (like 3/8 inch or 25 px) between them. This is driving me bananas.
What the hey am I missing?

dh
------------------------------------------------
Dan Hansen
------------------------------------------------
Jul 20 '05 #1
Share this Question
Share on Google+
8 Replies


P: n/a
Daniel Hansen <dr***********************@mindspring.com> wrote:
I know this must seem totally basic and stupid, but I cannot find any reference that describes how to control the spacing between <p>...</p> and
<div>...</div> blocks. When I implement these on a page, there is a huge gap (like 3/8 inch or 25 px) between them. This is driving me bananas.
What the hey am I missing?


^ please correct your news reader settings so that others can quote what
you wrote properly without having to reformat it.

Div's do not have top or bottom margin by default. Paragraphs do, as all
things presentational they can be controlled via CSS:
http://www.w3.org/TR/REC-CSS2/ (read it)

In this case you'd need something like this:

p{margin-top:1.2em;margin-bottom:1.2em}

Use classes if you don't want it to apply to all paragraphs.
Headless

Jul 20 '05 #2

P: n/a
On Sun, 13 Jul 2003 06:52:45 +0100, Headless <in*************@dna.ie>, wrote:
^ please correct your news reader settings so that others can quote what
you wrote properly without having to reformat it.
What exactly is the problem my reader is giving you that causes you to need to reformat my posts? You don't state that in your reply.

Div's do not have top or bottom margin by default. Paragraphs do, as all
things presentational they can be controlled via CSS:
http://www.w3.org/TR/REC-CSS2/ (read it)
I have looked at that. Those danged specs are written for people who live and breathe the stuff all day, and for them they must be clear. For mere
mortals and occasional/casual HTML writers like me who are asking plain-English questions like "how do I do X" trying to find answers in them is like
trying to swim in quicksand. They are incredibly opaque. I would not be posting a question here had I not first driven myself to distraction trying
to find my answer there and elsewhere online.
In this case you'd need something like this:

p{margin-top:1.2em;margin-bottom:1.2em}

Use classes if you don't want it to apply to all paragraphs.


It turns out I had created my own problem and was staring right at it without seeing it. My stylesheet entry contained "margin: 12px 0px 12px 0px;" I
just needed to change that to "margin: 2px 0px 2px 0px;" and life is good again. Must be some kind of temporary cognitive disorder...

Dan

------------------------------------------------
Dan Hansen
------------------------------------------------
Jul 20 '05 #3

P: n/a
Daniel Hansen wrote:
On Sun, 13 Jul 2003 06:52:45 +0100, Headless <in*************@dna.ie>, wrote:
>>^ please correct your news reader settings so that others can quote what
>>you wrote properly without having to reformat it.


What exactly is the problem my reader is giving you that causes you to need to reformat my posts? You don't state that in your reply.


I get *excessively* long lines that have to be manually rewrapped to be
readable at "normal" window sizes (~80 characters of monospace font). I
don't use Forte Agent, so I can't tell you how to fix it, but it does
need fixing.

--
To email a reply, remove (dash)ns(dash). Mail sent to the ns
address is automatically deleted and will not be read.

Jul 20 '05 #4

P: n/a
Tim
On Sun, 13 Jul 2003 06:52:45 +0100,
Headless <in*************@dna.ie>, wrote:
please correct your news reader settings so that others can quote what
you wrote properly without having to reformat it.

I can't help but butt in and mention that the blank spaces before
quote indicators don't help, either.
Daniel Hansen wrote:
What exactly is the problem my reader is giving you that causes you to
need to reformat my posts? You don't state that in your reply.

Excessively long line length. As it stands, it makes it hard to read
the text for a great many people (disappearing off the edge of the
screen, or badly wrapping). When it's quoted, and becomes quotes of
quotes, it gets even worse.
On Sun, 13 Jul 2003 14:16:49 -0500,
kchayka <kc*********@sihope.com> wrote:
I get *excessively* long lines that have to be manually rewrapped to be
readable at "normal" window sizes (~80 characters of monospace font). I
don't use Forte Agent, so I can't tell you how to fix it, but it does
need fixing.


"Options" menu, "posting preferences" menu item, "general" tab. Look
through the options, in there, and choose something like 72 characters
(long held as an appropriate line length - which suits plain text
readers, fancier readers, and web page based news interfaces).

--
My "from" address is totally fake. (Hint: If I wanted e-mails from
complete strangers, I'd have put a real one, there.) Reply to usenet
postings in the same place as you read the message you're replying to.
Jul 20 '05 #5

P: n/a
Ok... I get the message and have found and changed those settings.

So here is a line I am deliberately writing to blow well past the
72-char standard. Looks to me like it is wrapping as you suggested. If
not, please respond and I'll adjust further. Twas brillig in the slithy
toves, did gyre and gimbel in the wabe. All mimsy were the borogoves,
and the mome raths outgrabe. Beware the Jabberwock, my son....

How's it look?

d.
On Mon, 14 Jul 2003 08:44:25 +0930, Tim <ad***@sheerhell.lan>, wrote:
On Sun, 13 Jul 2003 06:52:45 +0100,
Headless <in*************@dna.ie>, wrote:
>> please correct your news reader settings so that others can quote what
>> you wrote properly without having to reformat it.


I can't help but butt in and mention that the blank spaces before
quote indicators don't help, either.
Daniel Hansen wrote:
What exactly is the problem my reader is giving you that causes you to
need to reformat my posts? You don't state that in your reply.


Excessively long line length. As it stands, it makes it hard to read
the text for a great many people (disappearing off the edge of the
screen, or badly wrapping). When it's quoted, and becomes quotes of
quotes, it gets even worse.
On Sun, 13 Jul 2003 14:16:49 -0500,
kchayka <kc*********@sihope.com> wrote:
I get *excessively* long lines that have to be manually rewrapped to be
readable at "normal" window sizes (~80 characters of monospace font). I
don't use Forte Agent, so I can't tell you how to fix it, but it does
need fixing.


"Options" menu, "posting preferences" menu item, "general" tab. Look
through the options, in there, and choose something like 72 characters
(long held as an appropriate line length - which suits plain text
readers, fancier readers, and web page based news interfaces).


------------------------------------------------
Dan Hansen
------------------------------------------------
Jul 20 '05 #6

P: n/a
Daniel Hansen wrote:
Ok... I get the message and have found and changed those settings.

So here is a line I am deliberately writing to blow well past the
72-char standard. Looks to me like it is wrapping as you suggested. If
not, please respond and I'll adjust further. Twas brillig in the slithy
toves, did gyre and gimbel in the wabe. All mimsy were the borogoves,
and the mome raths outgrabe. Beware the Jabberwock, my son....

How's it look?


Better. Now you'll get slammed for top-posting, and for the Jabberwocky
errors ('Twas brillig, and the ... gyre and gimble) ;-)

But to answer your original question, you need to find a basic CSS
tutorial. I have one on the way at:

http://www.tranchant.freeserve.co.uk/web/css-start.html

but I'm not going to be anywhere close to finishing it for a few weeks.
However, the basics about CSS are already there, which should help you
read the (actually very good) specs. I think the CSS1 spec is a better
document for beginners to read:

http://www.w3.org/TR/REC-CSS1

There are probably many others out there: try Google.

--
Mark.
http://www.tranchant.freeserve.co.uk/

Jul 20 '05 #7

P: n/a
Daniel Hansen <dr***********************@mindspring.com> wrote:
How's it look?


Please don't top post.

Secondly re-read Tim's advice on getting rid of the space before the
quote sign.
Headless

Jul 20 '05 #8

P: n/a
In article <95********************************@4ax.com>,
I have looked at that. Those danged specs are written for people who
live and breathe the stuff all day, and for them they must be clear.


There are a number of CSS tutorials out there. I've heard good things about
the one at http://www.westciv.com/style_master/.../css_tutorial/
--
Darin McGrew, mc****@stanfordalumni.org, http://www.rahul.net/mcgrew/
Web Design Group, da***@htmlhelp.com, http://www.HTMLHelp.com/

"You learn nothing new the third time a mule kicks you in the head."
Jul 20 '05 #9

This discussion thread is closed

Replies have been disabled for this discussion.