473,581 Members | 2,209 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 14456
Daniel Hansen <dr************ ***********@min dspring.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;margi n-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;margi n-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*********@si hope.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***@sheerhel l.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*********@si hope.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************ ***********@min dspring.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****@stanford alumni.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
2520
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 the <div> and the bottom of the <td>. I try to put margin-bottom:0 px to the <td>, <tr> also <table>, but there's still a space there. I need the...
61
24433
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 'stretch'</td> <td valign="top" width="300">some data that won't 'stetch'</td> </tr> </table>
8
5135
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 pulling a name and placing it under the thumbnail (the text is
2
7626
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 away to do that with this code: <p>a</p> <ul style="margin-top: -20; padding-top: 0"> <li>1</li>
61
9789
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 align: top, but this hasn't made a differance. http://www.paulwatt.info/test/calendar.htm Thanks guys
2
2957
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 background-color to the div, the color won't fill up the entire space I believe it should. The div only has color around the text though it has one line...
28
5334
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 </p>s included as well. <P>aaaaaaaaa</p><DIV>bbbbbbbbb</DIV><DIV>cccccccc<P>dddddddd</p></DIV>
5
13455
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 semantically meaningless containers for bunch's of other elements - like everyone keeps telling me to make my code standards compliant. This...
8
10026
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 editor. A fellow member of the PCG has helped me by creating a bit of Javascript to emulate the scrolling and using Google I've now gotten it into a...
0
7792
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language...
0
8149
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. ...
0
8304
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that...
1
7899
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For...
0
8175
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the...
0
6553
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then...
0
5364
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert...
1
2301
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
0
1138
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating...

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.