> For the complete documentation index, see [llms.txt](https://handbook.musescore.org/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://handbook.musescore.org/3/formatting/align-elements.md).

# Align elements

While dragging an element:

* To constrain movement to the **horizontal** only: Click and hold on the element, press <kbd>Ctrl</kbd>, then drag the element left or right.
* To constrain movement to the **vertical** only: Click and hold on the element, press <kbd>Shift</kbd>, then drag the element up or down.

## Snap to grid

**Snap to grid** is a feature which allows you to *drag* an element in precise steps—useful for exact positioning.

<figure><img src="/files/suJAtYooqGQdC4sSpZtz" alt="Snap to grid buttons"><figcaption></figcaption></figure>

To enable snap to grid, select an element and click one or both of the snap to grid buttons, located to the right of the X (horizontal) and Y (vertical) offset fields in the [Inspector](/3/basics/inspector.md). You can then *drag* the element in steps equal to the **grid spacing**. The default value is 0.5 [sp](/3/appendix/glossary.md#spatium).

To change the **grid spacing**:

1. Right-click on any of the snap to grid buttons in the Inspector, and select **Configure Grid**.
2. Set values for the horizontal and vertical grid spacing as required. Note that this is a fractional setting.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://handbook.musescore.org/3/formatting/align-elements.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
