Heights and widths

In the default settings, a form has no fixed height or width and simply takes up the space that it needs to. This typically means that the form will adapt to the height of its content. However, if you need a fixed height or a maximum width, you can configure these values individually for each embedding. To do this, form authors can specify the required dimensions of the form directly via the embedding page in the Formcentric Cloud interface.

The embedding code will then include a form container on which data attributes are defined for heights and widths. The Formcentric client sets the corresponding style attributes in the background and adjusts the form to the defined values automatically. As one example, confirmation messages will then be centred within the container. If scrolling is necessary, the client activates this automatically.

The data attributes also have the advantage of offering automated optimisation for mobile devices. As scrolling for this use case affects the entire page, containers with limits can worsen the user experience, as double scrolling is frequently problematical. On mobile devices, the form therefore ignores a configured height limit and automatically extends to its full height.

Example - Setting via the Formcentric Cloud interface

If you specify a fixed height of 800 px and a maximum width of 600 px using the Formcentric Cloud interface, this creates the following markup that you can include in your own web page:


Example - Setting directly in markup

If you want more precise control over your form dimensions, you can achieve this directly in markup by using your own style attributes, style tags or CSS files. This lets you adjust the form behaviour to meet your exact requirements.

1. Modify the form container style attribute:


2. Modify the form container with user-defined CSS:


3. Modify the parent element with markup and CSS:


Feedback

Was this article helpful?