How to insert header in Writer

I tried numerous times to insert a header in my document. Need help. If I start typing the body of the doc, then do Insert > Header and Footer > Header > First Page (or All), then insert an image, it does not insert it into the header. It inserts it into the document body. If I first type text into the head, I can then insert an image into the header. However, the header “margins” do not accommodate the image size and it spills over into the document body; whereupon I have to go the the first line of the document and hit the enter key several times to move the text below the header image. For quite some time I have been starting my documents needing header with images in Word, then I can open in Writer and continue editing.

Should have mentioned: LibreOffice 24.8.2.1 on Linux.

Right click on the image and select Anchor > As character. This is the same anchoring that Word uses but without the risk of introducing unwanted docx formatting.

If it is the same image in the same sort of page then consider making a template.
.
The Writer Guide is a good reference, download from English documentation | LibreOffice Documentation - LibreOffice User Guides

The anchor as character trick worked! It moved the image entirely into the header and put the body text outside the header. Not particularly intuitive. I would have never figured that out without your help! Thanks.

Because there are several anchor modes, each targeting a particular purpose.

Mixing graphical material with text is not “intuitive” at all. Graphics don’t interact natively with text because graphics and text are alien to each other unless you choose an adequate wrap mode (again another notion related to inserting non-text in a document). Wrap mode is a directive on how text “runs around” inserted object. There is Through where each lives its own life, ignoring the other (leading to overlap), Off where the image will expel text (using full width from margin to margin), and other options showing intermediate results.

Anchor mode dictates how the inserted object remains in relation with the anchor position when document text is modified. Anchor position is the location of the cursor at insertion time. As Character integrates the object inside text (it turns it into a huge character and everything you know about characters apply, as if you had typed it from the keyboard). In this mode, you can’t manually move the object; it is part of the text. To Paragraph and To Character are essentially the same and request that the object be located in the same page as the paragraph or character. Avoid To Page: it means the object will be statically and invariably linked to the present page, even if you delete text in preceding pages (leaving blank undeletable pages!). This last mode is more or less reserved for DTP-like (desktop publishing) jobs where text flow is not important but page layout is. Until you master the concept, avoid To Page to protect you from unexpected results.

You can position your object anywhere in the page in any mode except As Character.

As briefly described, you can see there are 3 main factors to consider when positioning an inserted object. Writer has a default of To Character, Parallel and center+top of paragraph area. It is usually necessary to adjust this. To automate the process, there is the notion of frame style. However, mastering frame styles is quite tricky because inserted objects are extremely sensitive to manual formatting, so sensitive it is utterly difficult to get rid of it and restore style settings effectiveness.