Styles go outside selection

I select a piece of text

I press a Style to apply to it (either from the quickbar or from the Styles and Formatting window).

It applies the style to way more text than I selected for no apparent reason. This obviously shouldn’t happen.

How do I remedy this?

You probably applied a paragraph style. Paragraph styles affect the entire paragraph, not just selected text. Page styles are even worse.

If that isn’t your problem, please give more information, like style name.

I was trying to apply styles like Title or Heading. If these are paragraph styles that makes even less sense to me, headers and titles do not make up entire paragraphs.

Worse?

@Masterfrog: yes those are paragraph styles; and that makes perfect sense, if you take into account, that technical term “paragraph” means “text between two paragraph breaks (= Enter)”. To make a heading, you put an Enter, then type the heading text, then put an Enter again, and then go on with the rest. So, your heading becomes enclosed between two paragraph marks, and so substitute a full paragraph of its own.

@Masterfrog: You may be mixing up the Dutch (or German) “paragraaf”, “section” in English, and English “paragraph”, which is “alinea” in Dutch.

Paragraph style? Character style? There’s a difference.

For better understandig view non-printable characters / formatting marks.

If you apply a new paragraph style it will apply to all the paragraphs that are wholly or partly included in the highlighted text. And a paragraph only ends (as far as LO is concerned) when a paragraph end mark is inserted by pressing the Enter key.

When I come across your problem it is usually because the text includes blank lines which give the appearance of separate paragraphs, while LO will apply the formatting to the following text up to the next paragraph end mark.

Set Writer to display at least some formatting marks including particularly “Paragraph end” “Breaks” and “Non breaking spaces”. To do this open the “Tools” menu and select “Options” > “LibreOffice Writer”>”Formatting Aids” for a list of what you can have displayed. Some people find the marks a bit off-putting but you should soon get used to them.