473,387 Members | 1,592 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

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

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
8 14438
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
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
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
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
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
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
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
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Terry | last post by:
hi guys, could anyone help me with this? I tried to put a <div> in a <td>, and a <table> in that <div>. It looks fine, but my div can't fit in my <td>, there's always a space between the bottom of...
61
by: Toby Austin | last post by:
I'm trying to replace <table>s with <div>s as much as possible. However, I can't figure out how to do the following… <table> <tr> <td valign="top" width="100%">some data that will...
8
by: slim | last post by:
hi again all, i am still working on the website as mentioned in earlier threads and have hit another snag... http://awash.demon.co.uk/index.php http://awash.demon.co.uk/vd.css the php is...
2
by: Shaun | last post by:
Hello! I have a quick question regarding CSS and having it applied to all elements. I am trying to eliminate the gap between a paragraph and a list that usually occurs in html and I've found...
61
by: Paul Watt | last post by:
Hi, i've placed a table within a <div> to dispay some data. All is well in FF, but in MSIE the table starts inline with the bottom of the <div> to the left. I've set the css div to vertical...
2
by: Nikolai Onken | last post by:
Hey, I am trying to learn the exact behavior of CSS and was just placing a couple of <div>'s after each other. Each of the <divhas a <pwithin and some text within the <p> Now when I add a...
28
by: Kent Feiler | last post by:
1. Here's some html from a W3C recommendations page. <P>aaaaaaaaa<DIV>bbbbbbbbb</DIV><DIV>cccccccc<P>dddddddd</DIV> 2.Although I didn't think it would make any difference, I tried it with the...
5
by: Agix | last post by:
Hi there, Please check out : http://clarifysolutions.co.uk/certenroll/ The source is included below. This page is a test, so I can play about with paddings, margins and layouts using divs as...
8
prino
by: prino | last post by:
Hi all, I've written code (in REXX) that takes files in legacy languages (PL/I, COBOL, z/OS assembler, etc) and converts them into HTML in a format similar to what's displayed in the z/OS ISPF...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.