Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > HTML > Default padding

Reply
Thread Tools

Default padding

 
 
UKuser
Guest
Posts: n/a
 
      02-22-2007
Hi,

Can someone tell me what the default margins & heights are for the p
tag please.

Thanks

A

 
Reply With Quote
 
 
 
 
John Hosking
Guest
Posts: n/a
 
      02-22-2007
UKuser wrote:
>
> Can someone tell me what the default margins & heights are for the p
> tag please.


Depends on the browser. They can all be different.

Try 'em and see.

--
John
 
Reply With Quote
 
 
 
 
Andy Dingley
Guest
Posts: n/a
 
      02-22-2007
On 22 Feb, 11:26, "UKuser" <(E-Mail Removed)> wrote:

> Can someone tell me what the default margins & heights are for the p
> tag please.


There are no "defaults" because there's no standard imposed on how
browsers should treat this. It's up to the browser author.

You might find this interesting though
http://www.w3.org/TR/CSS21/sample.html
It's a _suggested_ default style sheet for HTML.
In it we find that
p { margin: 1.12em 0; }

Note that the CSS-defined initial values (in the absence of a
stylesheeet) for padding are 0. These _are_ part of the formal
normative recommendation, unlike the suggested default stylesheet.
Also line-height has a normative initial value of "normal" which is
recommended (again a flexible suggestion, like the stylesheet) to
between 1.0 and 1.2. This fits with the default stylesheet value of
initial top and bottom margins being "one line height" rather than "1
em", as is often thought.

In practice the default stylesheet can generally be assumed to apply
to all desktop browsers, at least as far as it's _necessary_ to assume
anything about it. Assume it will be reasonable and workable, unless
you have a reason to start deliberately setting things differently.

<p> will be rendered in much this way across all common browsers. <li>
though is known to vary even between common browsers. Some default by
setting biggger margins on it, others do it by setting padding. If you
adjust either <li> settings, make sure that you take _both_ margin and
padding into the explicit control of your stylesheet.

Obviously it's all likely to be radically different for "non-
traditional" browsers and display devices.


 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Default padding for Tkinter grid Amr Python 2 05-04-2009 03:10 PM
VB code and Sql Server Ansi Padding =?Utf-8?B?U2FuZHk=?= ASP .Net 2 05-11-2005 07:16 PM
padding left-justified string fields Dave Perl 7 07-22-2004 09:55 AM
Padding between textboxes Becker ASP .Net 4 06-24-2004 04:00 PM
How to align table with some left padding? RA ASP .Net 1 02-19-2004 06:25 PM



Advertisments