Re: how to display the margin of a <p> element
On 17 mar, 19:14, Summercool <Summercooln...@gmail.com> wrote:
> The <p> is suggested in CSS Spec 2.1 to have a margin of 1.12em, and
> in Spec 2.0, to have 1.33em...
>
> But looks like Firefox and Safari both use 1em for it. And IE use
> something less... maybe 0.5em
Which version of IE exactly? There are many differences between the IE
versions. FWIW, IE 8 beta 1 uses the CSS 2.1 spec. declaration of
1.12em.
> I wonder if there is a way to find out how the <p> is defined as a
> default value in your browser?
Install IE developer toolbar in IE 7: IIRC, it will return "auto"
also.
Set the font-size to 100px or some large number and then view the
background color against a grid or ruler on the side of the <p>. As
you noticed, some unspecified versions of IE will return "auto".
> One way might be to use javascript, but
>
> alert(document.getElementById("ha").style.margin_t op)
> alert(document.getElementById("ha").style.margin)
The above code would be good for inline style, not user-agent
(browser) default values.
Gérard
|