{"id":1612327,"date":"2020-05-13T14:24:00","date_gmt":"2020-05-13T14:24:00","guid":{"rendered":"https:\/\/toolset.com\/?post_type=course-lesson&#038;p=1612327"},"modified":"2021-05-11T07:05:21","modified_gmt":"2021-05-11T07:05:21","slug":"styling-front-end-forms","status":"publish","type":"course-lesson","link":"https:\/\/toolset.com\/fr\/course-lesson\/styling-front-end-forms\/","title":{"rendered":"Styling Front-End Forms"},"content":{"rendered":"\n<h2 class=\"wp-block-heading\"><strong>Design guidelines for front-end forms<\/strong><\/h2>\n\n\n\n<p>Your theme can affect the design of your form elements. For example, if in the Customizer you have a style set for the appearance of a button, then your form will use that style.&nbsp;<\/p>\n\n\n\n<p>To change the appearance of your form, you must use CSS.&nbsp;<\/p>\n\n\n\n<p>Follow these design tips to make your forms look professional.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Style your form consistently<\/h3>\n\n\n\n<p>Keep your design consistent across your site. This means making sure that your form\u2019s buttons, shapes, colors, fields, styling, padding, and margins align with the rest of your site design.&nbsp;<\/p>\n\n\n\n<div class=\"wp-block-toolset-blocks-grid tb-grid\" data-toolset-blocks-grid=\"3d9c399fe625e1b972f817a0680229f6\">\n<div class=\"wp-block-toolset-blocks-grid-column tb-grid-column tb-grid-align-top\" data-toolset-blocks-grid-column=\"3034fbe886c11054e95b46b09d3e4112\">\n<p><strong>This color palette is blue and white, with orange as the accent color<\/strong><\/p>\n\n\n<div class=\"wp-block-image\">\n<figure class=\" tb-image tb-image-dynamic aligncenter\" data-toolset-blocks-image=\"9ed8d5a04989acfdedf7f033187c32dc\"><a href=\"https:\/\/toolset.com\/wp-content\/uploads\/2021\/05\/toolset-design-front-end-forms-colors-1-2.png\"><img decoding=\"async\" loading=\"lazy\" src=\"https:\/\/toolset.com\/wp-content\/uploads\/2021\/05\/toolset-design-front-end-forms-colors-1-2-500x407.png\" alt=\"\" class=\"wp-image-2045821\"\/><\/a><\/figure>\n<\/div><\/div>\n\n\n\n<div class=\"wp-block-toolset-blocks-grid-column tb-grid-column tb-grid-align-top\" data-toolset-blocks-grid-column=\"3034fbe886c11054e95b46b09d3e4112\">\n<p><strong>This form\u2019s color palette is white, blue and uses orange as an accent on the button<\/strong><\/p>\n\n\n<div class=\"wp-block-image\">\n<figure class=\" tb-image tb-image-dynamic aligncenter\" data-toolset-blocks-image=\"62d3801247fc44c0e0c56d3974f6a2c0\"><a href=\"https:\/\/toolset.com\/wp-content\/uploads\/2021\/05\/toolset-design-front-end-forms-colors-2-1.png\"><img decoding=\"async\" loading=\"lazy\" src=\"https:\/\/toolset.com\/wp-content\/uploads\/2021\/05\/toolset-design-front-end-forms-colors-2-1-500x407.png\" alt=\"\" class=\"wp-image-2045833\"\/><\/a><\/figure>\n<\/div><\/div>\n<\/div>\n\n\n\n<h3 class=\"wp-block-heading\">Color coordinating your form<\/h3>\n\n\n\n<p>Your settings in the Customizer for your theme should automatically style your form color to match your website\u2019s color palette.&nbsp;<\/p>\n\n\n\n<p>If you add custom designs to your form, keep it simple by adding nice touches such as only incorporating your palette colors or only using your accent color for any icons, borders, or fields. Don\u2019t overdo this option because your design could quickly become messy.&nbsp;<\/p>\n\n\n<div class=\"wp-block-image\">\n<figure class=\" tb-image tb-image-dynamic aligncenter\" data-toolset-blocks-image=\"5caa7decd1882c6ae79c71868426121a\"><a href=\"https:\/\/toolset.com\/wp-content\/uploads\/2021\/05\/toolset-design-front-end-form.png\"><img decoding=\"async\" loading=\"lazy\" src=\"https:\/\/toolset.com\/wp-content\/uploads\/2021\/05\/toolset-design-front-end-form-500x272.png\" alt=\"\" class=\"wp-image-2042073\"\/><\/a><div class=\"tb-image-caption\"><figcaption>A form on the front-end<\/figcaption><\/div><\/figure>\n<\/div>\n\n\n<h3 class=\"wp-block-heading\">Improving text visibility<\/h3>\n\n\n\n<p>Use a background overlay if your form has an image set for the background. This is important because your text might not be visible enough, which does not look professional or trustworthy to clients.&nbsp;<\/p>\n\n\n\n<div class=\"wp-block-toolset-blocks-grid tb-grid\" data-toolset-blocks-grid=\"3d9c399fe625e1b972f817a0680229f6\">\n<div class=\"wp-block-toolset-blocks-grid-column tb-grid-column tb-grid-align-top\" data-toolset-blocks-grid-column=\"3034fbe886c11054e95b46b09d3e4112\">\n<p><strong>A form whose text is hard to read, and the picture takes over<\/strong><\/p>\n\n\n<div class=\"wp-block-image\">\n<figure class=\" tb-image tb-image-dynamic aligncenter\" data-toolset-blocks-image=\"4406c56ea851f693c65480ec1092d53c\"><a href=\"https:\/\/toolset.com\/wp-content\/uploads\/2021\/05\/toolset-design-front-end-form-no-overlay-1.png\"><img decoding=\"async\" loading=\"lazy\" src=\"https:\/\/toolset.com\/wp-content\/uploads\/2021\/05\/toolset-design-front-end-form-no-overlay-1-500x420.png\" alt=\"\" class=\"wp-image-2042109\"\/><\/a><\/figure>\n<\/div><\/div>\n\n\n\n<div class=\"wp-block-toolset-blocks-grid-column tb-grid-column tb-grid-align-top\" data-toolset-blocks-grid-column=\"3034fbe886c11054e95b46b09d3e4112\">\n<p><strong>A form whose text is hard to read, and the picture takes over<\/strong><\/p>\n\n\n<div class=\"wp-block-image\">\n<figure class=\" tb-image tb-image-dynamic aligncenter\" data-toolset-blocks-image=\"966f23bb6c7b513a5bf487b60b2ac99e\"><a href=\"https:\/\/toolset.com\/wp-content\/uploads\/2021\/05\/toolset-design-front-end-form-with-overlay.png\"><img decoding=\"async\" loading=\"lazy\" src=\"https:\/\/toolset.com\/wp-content\/uploads\/2021\/05\/toolset-design-front-end-form-with-overlay-500x420.png\" alt=\"\" class=\"wp-image-2042099\"\/><\/a><\/figure>\n<\/div><\/div>\n<\/div>\n\n\n\n<p>To create your background overlay, follow the process below:<\/p>\n\n\n\n<ol class=\"wp-block-list\"><li>In block navigation, select the <strong>Container<\/strong> block.<\/li><li>On the right sidebar, expand the <strong>Background <\/strong>panel.<\/li><li>Next to <strong>Overlay Color<\/strong>, click on the circle to begin adjusting the color you want.<\/li><\/ol>\n\n\n\n<p>Toolset makes it very easy to make simple adjustments like this, so you don\u2019t need to know how to code.<\/p>\n\n\n<div class=\"wp-block-image\">\n<figure class=\" tb-image tb-image-dynamic aligncenter\" data-toolset-blocks-image=\"4fca5aaa3bc62acbd47529df1dc9bdee\"><a href=\"https:\/\/toolset.com\/wp-content\/uploads\/2021\/05\/toolset-design-front-end-form-gray-overlay.png\"><img decoding=\"async\" loading=\"lazy\" src=\"https:\/\/toolset.com\/wp-content\/uploads\/2021\/05\/toolset-design-front-end-form-gray-overlay-500x239.png\" alt=\"\" class=\"wp-image-2042119\"\/><\/a><div class=\"tb-image-caption\"><figcaption>Toolset Container block with a grey overlay color<\/figcaption><\/div><\/figure>\n<\/div>\n\n\n<h3 class=\"wp-block-heading\">Controlling the width of your form<\/h3>\n\n\n\n<p>If the width of your form does not fit the way you want it to on your screen, use a <strong>Container<\/strong> block to control it. Select the <strong>Container <\/strong>block from block navigation and expand the <strong>Inner Content<\/strong> panel on the right sidebar.&nbsp;<\/p>\n\n\n<div class=\"wp-block-image\">\n<figure class=\" tb-image tb-image-dynamic aligncenter\" data-toolset-blocks-image=\"cacca76b422b750e062ae81e9affa1f6\"><a href=\"https:\/\/toolset.com\/wp-content\/uploads\/2021\/05\/toolset-design-front-end-form-max-width.png\"><img decoding=\"async\" loading=\"lazy\" src=\"https:\/\/toolset.com\/wp-content\/uploads\/2021\/05\/toolset-design-front-end-form-max-width-500x255.png\" alt=\"\" class=\"wp-image-2042129\"\/><\/a><div class=\"tb-image-caption\"><figcaption>Controlling the width of the form by setting a Max-Width<\/figcaption><\/div><\/figure>\n<\/div>\n\n\n<p>In the example below, setting the <strong>Max-Width<\/strong> of the <strong>Container<\/strong> to <strong>800<\/strong> <strong>px <\/strong>prevents the form from being too wide.<\/p>\n\n\n\n<div class=\"wp-block-toolset-blocks-grid tb-grid\" data-toolset-blocks-grid=\"3d9c399fe625e1b972f817a0680229f6\">\n<div class=\"wp-block-toolset-blocks-grid-column tb-grid-column tb-grid-align-top\" data-toolset-blocks-grid-column=\"3034fbe886c11054e95b46b09d3e4112\">\n<p><strong>The form in this example very wide<\/strong><\/p>\n\n\n<div class=\"wp-block-image\">\n<figure class=\" tb-image tb-image-dynamic aligncenter\" data-toolset-blocks-image=\"a1703b6124881fa2e9ec134e08dbd823\"><a href=\"https:\/\/toolset.com\/wp-content\/uploads\/2021\/05\/toolset-design-front-end-form-wide-form-1.png\"><img decoding=\"async\" loading=\"lazy\" src=\"https:\/\/toolset.com\/wp-content\/uploads\/2021\/05\/toolset-design-front-end-form-wide-form-1-500x419.png\" alt=\"\" class=\"wp-image-2042163\"\/><\/a><\/figure>\n<\/div><\/div>\n\n\n\n<div class=\"wp-block-toolset-blocks-grid-column tb-grid-column tb-grid-align-top\" data-toolset-blocks-grid-column=\"3034fbe886c11054e95b46b09d3e4112\">\n<p><strong>The form in this example is compact<\/strong><\/p>\n\n\n<div class=\"wp-block-image\">\n<figure class=\" tb-image tb-image-dynamic aligncenter\" data-toolset-blocks-image=\"c174f525da6b13c857898f947f1d9f07\"><a href=\"https:\/\/toolset.com\/wp-content\/uploads\/2021\/05\/toolset-design-front-end-form-compact-form.png\"><img decoding=\"async\" loading=\"lazy\" src=\"https:\/\/toolset.com\/wp-content\/uploads\/2021\/05\/toolset-design-front-end-form-compact-form-500x419.png\" alt=\"\" class=\"wp-image-2042153\"\/><\/a><\/figure>\n<\/div><\/div>\n<\/div>\n\n\n\n<h2 class=\"wp-block-heading\"><strong>How to style front-end forms<\/strong><\/h2>\n\n\n\n<p>You can style forms by adding CSS to them.<\/p>\n\n\n\n<p>There are two ways to do this:<\/p>\n\n\n\n<ul class=\"wp-block-list\"><li>Add styling rules for existing form elements<\/li><li>Edit the form in <strong>Expert mode <\/strong>and add custom CSS to both form elements and the entire form<\/li><\/ul>\n\n\n\n<h2 class=\"wp-block-heading\"><strong>Where to add your custom CSS<\/strong><\/h2>\n\n\n\n<p>When editing any Toolset form, click the <strong>CSS Editor<\/strong> link below the editor. A text box slides open, and you can put any custom CSS into it.<\/p>\n\n\n<div class=\"wp-block-image\">\n<figure class=\" tb-image tb-image-dynamic aligncenter\" data-toolset-blocks-image=\"f150868cae1cf6bfab672f19f33e44be\"><a href=\"https:\/\/toolset.com\/wp-content\/uploads\/2021\/05\/toolset-forms-custom-css-editor.png\"><img decoding=\"async\" loading=\"lazy\" src=\"https:\/\/toolset.com\/wp-content\/uploads\/2021\/05\/toolset-forms-custom-css-editor-500x386.png\" alt=\"\" class=\"wp-image-2042203\"\/><\/a><div class=\"tb-image-caption\"><figcaption>Opening the CSS editor when editing a Toolset form<\/figcaption><\/div><\/figure>\n<\/div>\n\n\n<p><em>Opening the <\/em><strong><em>CSS editor<\/em><\/strong><em> when editing a Toolset form<\/em><\/p>\n\n\n\n<p>Alternatively, you can add your custom CSS using the WordPress Customizer or directly to your (child) theme\u2019s stylesheet.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><strong>Add custom CSS for form elements<\/strong><\/h2>\n\n\n\n<p>Watch a quick video that explains how to add custom CSS for existing form elements.<\/p>\n\n\n\n<div class=\"tb-youtube\" data-toolset-blocks-youtube=\"65dc0a4b5c7e6e9f7ae56d4332f96aa6\"><div><iframe data-src=\"https:\/\/www.youtube.com\/embed\/au2ZCEQF5-0?rel=0&#038;toolset=1\" frameBorder=\"0\" allow=\"accelerometer; autoplay; encrypted-media; gyroscope; picture-in-picture\" allowfullscreen><\/iframe><\/div><\/div>\n\n\n\n<p>To add custom CSS rules for form elements, you don\u2019t need to switch to the <strong>Expert mode<\/strong>.<\/p>\n\n\n\n<p>First, you have to find out the names of the form elements you want to adjust:<\/p>\n\n\n\n<ol class=\"wp-block-list\"><li>Visit the page that holds your form on the front-end.<\/li><li>Open your browser\u2019s <strong>Developer Console<\/strong>. In most browsers, the easiest way is to click the <strong>F12 <\/strong>key on the keyboard.<\/li><li>In the Developer Console, click to use the \u201cinspector\u201d tool. Use it to hover over the page elements and select the one you want to inspect.<\/li><li>Once you select the form element, you can see its HTML tag highlighted in the Developer Console. Note down the name of the element and any CSS classes, if necessary.<\/li><\/ol>\n\n\n\n<p>Once you know the name of the element, add custom CSS for it.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><strong>Add custom CSS classes to form elements<\/strong><\/h2>\n\n\n\n<p>Adding custom classes to form elements allows you to create custom CSS rules and target those exact elements.<\/p>\n\n\n\n<p>Watch a quick video that explains how to add custom CSS classes to form elements:<\/p>\n\n\n\n<div class=\"tb-youtube\" data-toolset-blocks-youtube=\"12feb8a7c9dbcf5eeefa63a60ca6d98b\"><div><iframe data-src=\"https:\/\/www.youtube.com\/embed\/uBUO6GyN1Wk?rel=0&#038;toolset=1\" frameBorder=\"0\" allow=\"accelerometer; autoplay; encrypted-media; gyroscope; picture-in-picture\" allowfullscreen><\/iframe><\/div><\/div>\n\n\n\n<p>To add custom classes to form elements, use the <strong>Expert mode <\/strong>toggle to switch to the markup editor.<\/p>\n\n\n\n<p>In this mode, you can see and edit the markup of all elements that are already part of the form. Of course, you can also add any custom HTML markup.<\/p>\n\n\n\n<p>For example, you can:<\/p>\n\n\n\n<ol class=\"wp-block-list\"><li>change the labels for the inputs<\/li><li>add custom CSS classes to the elements<\/li><li>customize the HTML structure of the form<\/li><li><a href=\"https:\/\/toolset.com\/course-lesson\/adding-generic-fields-to-forms\/\">insert generic fields<\/a><\/li><li><a href=\"https:\/\/toolset.com\/course-lesson\/conditional-display-for-form-inputs\/\">display certain sections conditionally<\/a><\/li><\/ol>\n\n\n\n<p>Please note that the changes you make in the HTML editor will be lost if you switch back to the <strong>Visual editor.<\/strong><\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><strong>Do not load Forms stylesheet on the front-end<\/strong><\/h2>\n\n\n\n<p>If you want to disable the default styling to be loaded by Forms, you can set this in the settings. Go to the <strong>Toolset <\/strong>\u2192 <strong>Settings <\/strong>page and click the <strong>Forms <\/strong>tab. There, select the <strong>Do not load Forms style sheets on front-end<\/strong> option in the <strong>Styling <\/strong>section.<\/p>\n","protected":false},"author":84277,"featured_media":1631605,"template":"","related-lesson":[8417,8429],"class_list":["post-1612327","course-lesson","type-course-lesson","status-publish","has-post-thumbnail","hentry","related-lesson-designing","related-lesson-post-forms"],"_links":{"self":[{"href":"https:\/\/toolset.com\/fr\/wp-json\/wp\/v2\/course-lesson\/1612327","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/toolset.com\/fr\/wp-json\/wp\/v2\/course-lesson"}],"about":[{"href":"https:\/\/toolset.com\/fr\/wp-json\/wp\/v2\/types\/course-lesson"}],"author":[{"embeddable":true,"href":"https:\/\/toolset.com\/fr\/wp-json\/wp\/v2\/users\/84277"}],"version-history":[{"count":8,"href":"https:\/\/toolset.com\/fr\/wp-json\/wp\/v2\/course-lesson\/1612327\/revisions"}],"predecessor-version":[{"id":2051397,"href":"https:\/\/toolset.com\/fr\/wp-json\/wp\/v2\/course-lesson\/1612327\/revisions\/2051397"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/toolset.com\/fr\/wp-json\/wp\/v2\/media\/1631605"}],"wp:attachment":[{"href":"https:\/\/toolset.com\/fr\/wp-json\/wp\/v2\/media?parent=1612327"}],"wp:term":[{"taxonomy":"related-lesson","embeddable":true,"href":"https:\/\/toolset.com\/fr\/wp-json\/wp\/v2\/related-lesson?post=1612327"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}