Form Inputs with Icons Template

Add clarity and a modern touch to your forms by embedding icons directly inside the input fields.

This template uses simple CSS positioning to place an icon inside an input, providing a strong visual cue for the user about the field's purpose.

Screenshot of a form where each input field has a small icon on the left side, such as a user or envelope icon.

Get Source Code → Preview →

About this "Inputs with Icons" Form

Placing an icon inside an input field is a common UI pattern that reinforces the field's purpose. A user icon for "Username" or an envelope for "Email" makes the form quicker to scan and understand. This template achieves the effect with a combination of HTML structure and CSS positioning.

Each form group is a container with position: relative;. The icon (an SVG in this example) is absolutely positioned within this container. To prevent the user's typed text from overlapping the icon, padding is added to the left side of the input element, creating a neat space for the icon to live.

Features

Dependencies

None. This template uses only pure HTML and CSS.

Code

Here's the full code for the form with icon inputs:

View Output