PRACTICAL WEB TIP
Input Format Guide
An example and formatting guide appear when a phone-number input is hovered or focused.
Live Demo
Hover over the element or use Tab to focus.
Source Code
Copy the HTML, CSS or JavaScript you need for your project.
HTML
<div class="tbx-1300"><label for="tbx-1300-phone">Phone number <span>*</span></label><input id="tbx-1300-phone" type="tel" autocomplete="tel" placeholder="090 0000 0000" aria-describedby="tbx-1300-help"/><div class="tbx-1300__guide" id="tbx-1300-help"><span>FORMAT GUIDE</span><b>090-1234-5678</b><small>Use numbers and hyphens</small></div></div>
CSS
*{box-sizing:border-box}
.tbx-1300{width:294px;max-width:100%;height:156px;position:relative;padding:19px;background:#eef3f9;border:1px solid #d6e0ef;border-radius:10px;font-family:system-ui,sans-serif;color:#253c57}.tbx-1300 label{display:block;font-size:13px;font-weight:740;margin-bottom:10px}.tbx-1300 label span{color:#c64e42}.tbx-1300 input{width:100%;height:39px;border:1px solid #c1cfde;background:white;color:#183852;border-radius:5px;padding:0 12px;font:13px system-ui,sans-serif;outline:none;transition:border-color .3s,box-shadow .3s}.tbx-1300 input:hover,.tbx-1300 input:focus-visible{border-color:#5989bc;box-shadow:0 0 0 3px #8baddb32}.tbx-1300__guide{position:absolute;left:19px;right:19px;bottom:10px;display:flex;align-items:center;justify-content:space-between;gap:5px;transform:translateY(12px);opacity:0;transition:transform .34s,opacity .34s;pointer-events:none}.tbx-1300__guide span{font-size:8px;letter-spacing:.1em;color:#5279a0;font-weight:750}.tbx-1300__guide b{font-size:11px}.tbx-1300__guide small{font-size:8px;color:#7890a6}.tbx-1300:hover .tbx-1300__guide,.tbx-1300:focus-within .tbx-1300__guide{opacity:1;transform:translateY(0)}
@media (prefers-reduced-motion:reduce){.tbx-1300 *,.tbx-1300::before,.tbx-1300::after{animation:none!important;transition:none!important;scroll-behavior:auto!important}}
How to Use
Insert the HTML and add the CSS to your stylesheet. Adjust colors and sizes and avoid class conflicts.
Use Case
Useful for forms and contact sections.
Technical Notes
Keep controls usable on touch devices. Test keyboard focus and reduced-motion preferences.
Mobile:Ensure the interactive content remains accessible without hover on touch devices.
Browser:Uses modern CSS. Check behavior in the browsers you support.
Reduced Motion:Check that prefers-reduced-motion is respected.