You must understand Writer is not an HTML composer, i.e. you won’t write manually HTML tags, elements or attributes.
When formatting, Writer understands its own styles. Formatting is controlled by paragraph, character, list and frame styles (page styles are not relevant for HTML). You can also experiment with direct formatting, i.e. applying formatting variants with toolbar buttons, but this ersatz for styles is not recommended.
When you save the document with filename extension .html, the internal structure is translated by an export filter, converting the styles (and anonymous formatting) to CSS. You can’t inject directly CSS or interfere with HTML tag attributes.
In Writer, whenever you hit Return
, this creates a paragraph (not a line break), eventually empty (this explains why you should never use the Return
key for vertical spacing). Then, paragraphs are always translated as <p class=some_style>Contents of paragraph</p>
. Empty paragraphs come as <p class=some_style></p>
resulting in blank space (at least padding+border size).
To answer your question, use Writer “as usual” to layout your document, without caring for CSS styles or switch to an HTML dedicated composer.
To show the community your question has been answered, click the ✓ next to the correct answer, and “upvote” by clicking on the ^ arrow of any helpful answers. These are the mechanisms for communicating the quality of the Q&A on this site. Thanks!