473,382 Members | 1,731 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,382 software developers and data experts.

Amount of space after <p> paragraph tag.

I notice that the <ptag does not always allow the same amount of
space. Some websites have about half a line only. When I check their
code, they have used just <p>. On other occasions it seems that <p>
has left not just one line of space as per the current font size, but
as much as 20 or 30 pixels.

Can someone please explain to me how to control what <pdoes in terms
of space after a paragraph using a CSS.
Dec 3 '07 #1
5 11717
In article
<22**********************************@b40g2000prf. googlegroups.co
m>,
RetroMIDI <mu********@gmail.comwrote:
I notice that the <ptag does not always allow the same amount of
space. Some websites have about half a line only. When I check their
code, they have used just <p>. On other occasions it seems that <p>
has left not just one line of space as per the current font size, but
as much as 20 or 30 pixels.

Can someone please explain to me how to control what <pdoes in terms
of space after a paragraph using a CSS.
You can control this by setting your own margin and padding on
paragraphs instead of letting the individual browsers set their
own styles. Need an example?

--
dorayme
Dec 3 '07 #2

"RetroMIDI" <mu********@gmail.comwrote in message
news:22**********************************@b40g2000 prf.googlegroups.com...
>I notice that the <ptag does not always allow the same amount of
space. Some websites have about half a line only. When I check their
code, they have used just <p>. On other occasions it seems that <p>
has left not just one line of space as per the current font size, but
as much as 20 or 30 pixels.

Can someone please explain to me how to control what <pdoes in terms
of space after a paragraph using a CSS.
Here's my 'standard' p redefinition that you can play with/modify to suit:

p {
padding: 0;
margin-top: 0;
margin-right: 0;
margin-bottom: 1em;
margin-left: 0;
}

What does it do? It stops all padding and margins for all p tags, and adds a
1em margin to the bottom.

It's important that you do not use pixel spacings for (at least) textual
elements. If the viewer changes their viewable font size, it is desirable
that any white space also changes to suit.

Dec 3 '07 #3
On 3 Dec, 00:01, RetroMIDI <murray....@gmail.comwrote:
I notice that the <ptag does not always allow the same amount of
space.
It has however much space you specify in CSS, together with the notes
on how these CSS rules should be interpreted.

One aspect that hasn't been mentioned here is "collapsing vertical
margins".

Read all about it here:
http://brainjar.com/css/positioning/

Dec 3 '07 #4
On 2 déc, 19:44, dorayme <doraymeRidT...@optusnet.com.auwrote:
In article
<22ff74cf-76f8-4770-bfc6-b1fea5b8c...@b40g2000prf.googlegroups.co
m>,

RetroMIDI <murray....@gmail.comwrote:
I notice that the <ptag does not always allow the same amount of
space. Some websites have about half a line only. When I check their
code, they have used just <p>. On other occasions it seems that <p>
has left not just one line of space as per the current font size, but
as much as 20 or 30 pixels.
Can someone please explain to me how to control what <pdoes in terms
of space after a paragraph using a CSS.

You can control this by setting your own margin and padding on
paragraphs instead of letting the individual browsers set their
own styles. Need an example?

--
dorayme

Hello all,

Sometimes, it's due to a bug too...

http://www.gtalbot.org/BrowserBugsSe...arginAuto.html

http://www.gtalbot.org/BrowserBugsSe...Disappear.html

Gérard
Dec 4 '07 #5
In article
<31**********************************@o6g2000hsd.g ooglegroups.com
>,
GTalbot <ne*******@gtalbot.orgwrote:
On 2 déc, 19:44, dorayme <doraymeRidT...@optusnet.com.auwrote:
Can someone please explain to me how to control what <pdoes in
terms
of space after a paragraph using a CSS.
You can control this by setting your own margin and padding on
paragraphs instead of letting the individual browsers set their
own styles. Need an example?
Sometimes, it's due to a bug too...
>
http://www.gtalbot.org/BrowserBugsSe...WithMarginAuto
.html

http://www.gtalbot.org/BrowserBugsSe...nDisappear.htm
l
I have bookmarked your extremely useful:

http://www.gtalbot.org/BrowserBugsSection/

--
dorayme
Dec 4 '07 #6

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: Jim Fischer | last post by:
Paragraph 10.3/2 in the C++ standard has the following code example: <quote> struct A { virtual void f(); }; struct B : virtual A { virtual void f(); };
2
by: Eshrath | last post by:
Hi, What I am trying to do: ======================= I need to form a table in html using the xsl but the table that is formed is quite long and cannot be viewed in our application. So we are...
2
by: Donald Firesmith | last post by:
I am having trouble having Google Adsense code stored in XSL converted properly into HTML. The <> unfortunately become &lt; and &gt; and then no longer work. XSL code is: <script...
27
by: dip | last post by:
pardon the coversational manner of my thread subject. i'm having issues with the way that the two browsers handle CSS. this is an element i've defined in my style sheet. =========== sm {...
1
by: RJN | last post by:
Hi I'm using XMLTextReader to parse the contents of XML. I have issues when the xml content itself has some special characters like & ,> etc. <CompanyName>Johnson & Jhonson</CompanyName>...
11
by: Squeamizh | last post by:
class my_class { public: my_class() : value(0) { } int& get_value() { return value; } const int& get_value() const { my_class& c = const_cast<my_class&>(*this); return c.get_value(); }
3
by: ajay2552 | last post by:
Hi, I have a query. All html tags start with < and end with >. Suppose i want to display either '<' or '>' or say some text like '<Company>' in html how do i do it? One method is to use &lt,...
13
by: Sebastian Faust | last post by:
Hi, I hava a somehow strange problem. I hope I am not wrong in this group; if this is the case please let me know. I am trying to compile a rather simple C program. As long as I use: #include...
56
by: Zytan | last post by:
Obviously you can't just use a simple for loop, since you may skip over elements. You could modify the loop counter each time an element is deleted. But, the loop ending condition must be...
14
by: Michael | last post by:
Since the include function is called from within a PHP script, why does the included file have to identify itself as a PHP again by enclosing its code in <?php... <?> One would assume that the...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
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: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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...

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.