Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Some more CSS properties for HTML-enabled labels #9502

Merged
merged 1 commit into from
Dec 28, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 19 additions & 0 deletions docs/user_manual/style_library/label_settings.rst
Original file line number Diff line number Diff line change
Expand Up @@ -209,6 +209,25 @@ we invite you to explore and test in your labels
* Text decorations such as underline, overline and line-through (``text-decoration``)
* Text alignment (``vertical-align``, ``text-align``).
Horizontal alignment can not be used for curved labels.
* Line height, in ``points`` or ``percent`` unit, e.g. "line-height: 40pt" or "line-height: 40%"
* Background properties such as ``background-color`` and ``background-image``.
They are supported for block type items (e.g. ``div``) or inline items (e.g. ``span``).
For images, the CSS should be formatted as ``background-image: url(xx)``
and supports local file paths, HTTP links, or base64 embedded content.

.. attention:: Backgrounds are not supported for curved text and are always rendered
above any background shape for the label, and below drop shadows/buffers properties.

* Margin properties, available for block type items only, such as ``div``, ``p``, ``h1``,...
They can be specified in either the longhand or shorthand way, in ``points`` unit only.
Negative values can be set for the bottom margin.

.. code-block:: html

<div class="myDiv">
<h2 style="margin-left: 5pt; margin-right: 10pt">QGIS still rocks...</h2>
<p style="margin: 5pt 0pt -10pt 0pt">Thanks to you!!</p>
</div>

CSS properties can be set on HTML tags with the ``style`` attribute.
The HTML tag ``span`` does not apply any formatting to text by itself
Expand Down
Loading