diff --git a/src/main/java/writer2latex/xhtml/content/TextParser.java b/src/main/java/writer2latex/xhtml/content/TextParser.java
index f2a03ff..e6cf2c2 100644
--- a/src/main/java/writer2latex/xhtml/content/TextParser.java
+++ b/src/main/java/writer2latex/xhtml/content/TextParser.java
@@ -1791,7 +1791,7 @@ public class TextParser extends Parser {
//Create header element
Element headerElement = converter.createElement("header");
if (marginBottom != null) {
- headerElement.setAttribute("style", "margin-bottom:"+getPageSc().scale(marginBottom)+";");
+ headerElement.setAttribute("style", "margin-bottom:"+getPageSc().scale(marginBottom)+"; height:auto; width:auto;");
}
Node pageNode = node.getParentNode();
pageNode.insertBefore(headerElement, node);
@@ -1825,7 +1825,7 @@ public class TextParser extends Parser {
//Create footer element
Element footerElement = converter.createElement("footer");
if (marginTop != null) {
- footerElement.setAttribute("style", "margin-top:"+getPageSc().scale(marginTop)+";");
+ footerElement.setAttribute("style", "margin-top:"+getPageSc().scale(marginTop)+"; height:auto; width:auto;");
}
Node pageNode = node.getParentNode();
pageNode.appendChild(footerElement);