<!-- mobian-agent-page publisher="dailydev" canonical="https://daily.dev/posts/single-digit-inputs-with-one-element-otp--sc6aymzr0" -->

---
title: Single-digit inputs with one element (OTP) | daily.dev
description: Learn how to convert a simple input into single-digit inputs using CSS. This technique is useful for One-Time Password fields and requires less than 15 CSS...
canonical: https://daily.dev/posts/single-digit-inputs-with-one-element-otp--sc6aymzr0
twitter:card: summary_large_image
twitter:site: @dailydotdev
og:type: website
og:site_name: daily.dev
og:title: Single-digit inputs with one element (OTP) | daily.dev
og:description: Learn how to convert a simple input into single-digit inputs using CSS. This technique is useful for One-Time Password fields and requires less than 15 CSS...
og:url: https://daily.dev/posts/single-digit-inputs-with-one-element-otp--sc6aymzr0
og:image: https://api.daily.dev/og/posts/sC6Aymzr0.png
og:image:alt: Single-digit inputs with one element (OTP)
og:image:width: 1200
og:image:height: 630
og:locale: en
---

> ## Documentation Index
> Fetch the complete documentation index at: https://daily.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# Single-digit inputs with one element (OTP)

**[CSS Tip](https://daily.dev/sources/csstip)** · 1 min read · 23 upvotes · 3 comments

## Summary

Learn how to convert a simple input into single-digit inputs using CSS. This technique is useful for One-Time Password fields and requires less than 15 CSS declarations.

## Full article

daily.dev links to this article rather than hosting it. Read it at the original source: <https://css-tip.com/single-digit-inputs/>

## Community discussion

Top comments from developers on daily.dev.

**@mouad\_dadda** · 3 upvotes

> **Thanks** , This is helpful 💢⚡

**@anooplamba** · 0 upvotes

> Was looking for this, thanks!

**@ivanw** · 0 upvotes

> This is a really creative way👍👍👍👍👍

## Similar posts on daily.dev

- [Don’t just attend KubeCon \+ CloudNativeCon, Merge Forward your experience\!](https://daily.dev/posts/don-t-just-attend-kubecon-cloudnativecon-merge-forward-your-experience--l0rpp73x8) · CNCF · 1 upvotes · 0 comments
- [Announcing H2 2026 KCDs](https://daily.dev/posts/announcing-h2-2026-kcds-m96goajm1) · CNCF · 1 upvotes · 0 comments
- [Two months of Open Community Groups](https://daily.dev/posts/two-months-of-open-community-groups-asf52zhbs) · CNCF · 0 upvotes · 0 comments

---

Tags: [#css](https://daily.dev/tags/css), [#ui-design](https://daily.dev/tags/ui-design)

[View this post on daily.dev](https://daily.dev/posts/single-digit-inputs-with-one-element-otp--sc6aymzr0)

```json
{"@context":"https://schema.org","@graph":[{"@type":"Organization","@id":"https://daily.dev/#organization","name":"daily.dev","url":"https://daily.dev","logo":{"@type":"ImageObject","url":"https://daily.dev/apple-touch-icon.png","width":180,"height":180},"sameAs":["https://twitter.com/dailydotdev","https://github.com/dailydotdev","https://www.linkedin.com/company/daily-dev-ltd"]},{"@type":"WebSite","@id":"https://daily.dev/#website","url":"https://daily.dev","name":"daily.dev","publisher":{"@id":"https://daily.dev/#organization"},"potentialAction":{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https://daily.dev/search?q={search_term_string}"},"query-input":"required name=search_term_string"}}]}
{"@context":"https://schema.org","@type":"TechArticle","headline":"Single-digit inputs with one element (OTP)","url":"https://daily.dev/posts/single-digit-inputs-with-one-element-otp--sc6aymzr0","mainEntityOfPage":{"@type":"WebPage","@id":"https://daily.dev/posts/single-digit-inputs-with-one-element-otp--sc6aymzr0"},"datePublished":"2024-05-14T14:43:10.735Z","dateModified":"2024-05-14T14:43:08.495Z","description":"Learn how to convert a simple input into single-digit inputs using CSS. This technique is useful for One-Time Password fields and requires less than 15 CSS...","image":"https://media.daily.dev/image/upload/f_auto,q_auto/v1/posts/80b9a0d6074d4dd3737dc9cc4f3710d9?_a=AQAEuiZ","thumbnailUrl":"https://media.daily.dev/image/upload/f_auto,q_auto/v1/posts/80b9a0d6074d4dd3737dc9cc4f3710d9?_a=AQAEuiZ","isAccessibleForFree":true,"articleSection":"CSS Tip","inLanguage":"en","publisher":{"@type":"Organization","name":"daily.dev","url":"https://daily.dev","logo":{"@type":"ImageObject","url":"https://daily.dev/apple-touch-icon.png","width":180,"height":180}},"author":{"@type":"Organization","name":"CSS Tip","logo":"https://media.daily.dev/image/upload/t_logo,f_auto/v1/logos/5d335233e7894c2ea997aa89e1724200","url":"https://daily.dev/sources/csstip"},"commentCount":3,"discussionUrl":"https://daily.dev/posts/single-digit-inputs-with-one-element-otp--sc6aymzr0","interactionStatistic":[{"@type":"InteractionCounter","interactionType":{"@type":"LikeAction"},"userInteractionCount":23},{"@type":"InteractionCounter","interactionType":{"@type":"CommentAction"},"userInteractionCount":3}],"keywords":"css,ui-design","timeRequired":"PT1M"}
{"@context":"https://schema.org","@type":"BreadcrumbList","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https://daily.dev"},{"@type":"ListItem","position":2,"name":"CSS Tip","item":"https://daily.dev/sources/csstip"},{"@type":"ListItem","position":3,"name":"Single-digit inputs with one element (OTP)"}]}
{"@context":"https://schema.org","@type":"WebPage","@id":"https://daily.dev/posts/single-digit-inputs-with-one-element-otp--sc6aymzr0","comment":[{"@type":"Comment","text":"Thanks , This is helpful 💢⚡","datePublished":"2024-05-15T00:27:19.079Z","url":"https://daily.dev/posts/sC6Aymzr0#c-bcD8AnUlo","author":{"@type":"Person","name":"Mouad Dadda","url":"https://daily.dev/mouad_dadda","image":"https://media.daily.dev/image/upload/s--qvecFxpC--/f_auto/v1746013117/avatars/avatar_cmPs2DO0hyj5zVizDLJDZ"},"interactionStatistic":{"@type":"InteractionCounter","interactionType":{"@type":"LikeAction"},"userInteractionCount":3}},{"@type":"Comment","text":"Was looking for this, thanks!","datePublished":"2024-05-19T04:39:20.588Z","url":"https://daily.dev/posts/sC6Aymzr0#c-n8Gi1c2gf","author":{"@type":"Person","name":"Anoop Lamba","url":"https://daily.dev/anooplamba","image":"https://lh3.googleusercontent.com/a/ACg8ocIfvwohjwZYvDma3Q9ZhEykHload2pFzlIdqAwTW8cuGNY=s96-c"}},{"@type":"Comment","text":"This is a really creative way👍👍👍👍👍","datePublished":"2024-08-12T02:54:35.075Z","url":"https://daily.dev/posts/sC6Aymzr0#c-Q1xDlEPWH","author":{"@type":"Person","name":"ivan0011 wang","url":"https://daily.dev/ivanw","image":"https://lh3.googleusercontent.com/a/ALm5wu0b7eCtfAW0s8Y-aRsl3YqDxF8SlHN-RlJMUyRy=s96-c"}}]}
```

