I am trying to remove all the <label>
tags from a shipping address form on the checkout page.
Here is the answer to hide those labels using CSS.
I am trying to move those labels below the input fields.
Any guidance would be appreciated.
checkoutlabelsmagento2shipping-address
I am trying to remove all the <label>
tags from a shipping address form on the checkout page.
Here is the answer to hide those labels using CSS.
I am trying to move those labels below the input fields.
Any guidance would be appreciated.
Best Answer
The form uses templates from the Magento UI module. You can override these in your custom theme.
The main template you should override is
vendor/magento/module-ui/view/frontend/web/templates/form/field.html
.There are some exceptions. E.g. the Email Address field is part of the Checkout module and to modify that you should override
vendor/magento/module-checkout/view/frontend/web/template/form/element/email.html
. Then there are also the address line fields which don't use labels but instead a fieldset with a legend. To modify this you could either use CSS to change the position of the legend or overridevendor/magento/module-ui/view/frontend/web/templates/group/group.html
to use something else instead of the legend.