Ask Your Question
0

HTML paragraphs extra bottom margin [closed]

asked 2013-06-18 17:08:22 +0200

Libero77 gravatar image

I have created a HTML file: image description

Set the bottom margin to zero: image description

And the next time when I open this file an extra bottom margin appear: image description

Where does this extra margin come from ?

edit retag flag offensive reopen merge delete

Closed for the following reason question is not relevant or outdated by Alex Kemp
close date 2015-11-02 19:29:11.495950

1 Answer

Sort by » oldest newest most voted
0

answered 2013-06-19 03:47:23 +0200

oweng gravatar image

IMO this is a bug, and fdo#62445 appears to be the related one. If you set Line Spacing to a Fixed value (e.g., 14.1pt), saving and re-opening the file results in not only the Line Spacing being reset to At Least but also this type of code in the HTML:

<STYLE TYPE="text/css">
<!--
    @page { margin: 72pt }
    P { margin-bottom: 0pt; line-height: 14.1pt; page-break-before: auto }
    A:link { so-language: zxx }
-->
</STYLE>

<P STYLE="margin-bottom: 14.2pt">Hun mä éiweg Hémecht, ass Himmel dämpen gehéiert fu. Da geet dann Gesträich dir, muerges Hemecht gin mä. Welt Milliounen da den. Wäit Hémecht Blieder mir dé, fu Hierz Gaart rei.</P>
<P STYLE="margin-bottom: 14.2pt">Dé Gaart Milliounen der. Wat Welt riede erwaacht an. Jo net päift Poufank, sech gefällt ass hu, denkt d'Leit de vun. Ké Duerf bleiwe mat. Wand heemlech schaddreg gei vu, duurch Blieder um och, ke fort Freiesch wee.</P>

Those margin-bottom attributes against each paragraph are part of the problem. Sadly though this is only part of the problem as browsers like Iceweasel/Firefox will add a paragraph margin to basic text. If you edit the above (using a text editor) to read:

<P>Hun mä éiweg Hémecht, ass Himmel dämpen gehéiert fu. Da geet dann Gesträich dir, muerges Hemecht gin mä. Welt Milliounen da den. Wäit Hémecht Blieder mir dé, fu Hierz Gaart rei.</P>
<P>Dé Gaart Milliounen der. Wat Welt riede erwaacht an. Jo net päift Poufank, sech gefällt ass hu, denkt d'Leit de vun. Ké Duerf bleiwe mat. Wand heemlech schaddreg gei vu, duurch Blieder um och, ke fort Freiesch wee.</P>

You will still get an implied (by Iceweasel/Firefox) top paragraph margin e.g.,

Firefox auto top margin

It is only through editing the CSS definition to explicitly set the top margin to 0pt that the desired display is possible:

    P { margin-bottom: 0pt; margin-top: 0pt; line-height: 14.1pt; page-break-before: auto }

Firefox auto top margin

As soon as you re-edit the HTML via Writer though this is overwritten. I think the "HTML (StarWriter)" filter needs to be more explicit in its setting of these margin values, based on the options and values of the Indents & Spacings tab (as you indicate).

edit flag offensive delete link more

Question Tools

Stats

Asked: 2013-06-18 17:08:22 +0200

Seen: 171 times

Last updated: Jun 19 '13