Skip to content

Commit 07ea351

Browse files
committed
[Cookbook][Forms] Add Asterisk alternative using CSS
1 parent 68e5211 commit 07ea351

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

cookbook/form/form_customization.rst

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -896,6 +896,17 @@ original template:
896896

897897
See :ref:`cookbook-form-theming-methods` for how to apply this customization.
898898

899+
.. tip::
900+
901+
Labels of required fields are rendered with a CSS class called ``required``
902+
by default. You can use it to add an Asterisk using CSS only:
903+
904+
.. code-block:: css
905+
906+
label.required:before {
907+
content: "* ";
908+
}
909+
899910
Adding "help" messages
900911
~~~~~~~~~~~~~~~~~~~~~~
901912

0 commit comments

Comments
 (0)