목차
none
numeric
tel
decimal
email
url
search
Additional Notes
Demo
References
웹 프론트엔드 CSS 튜토리얼 입력 모드에 대해 알고 싶었던 모든 것

입력 모드에 대해 알고 싶었던 모든 것

Apr 21, 2025 am 11:03 AM

입력 모드에 대해 알고 싶었던 모든 것

inputmode 속성은 터치 스크린 장치의 브라우저에 대한 귀중한 힌트를 제공하여 적절한 온 스크린 키보드를 선택하는 데 안내합니다.<input><textarea></textarea> elements. Unlike altering the input type, inputmode solely dictates keyboard display, not input interpretation.

While possessing a lengthy history, widespread adoption by major mobile browsers (Safari and Chrome) is relatively recent. Prior implementations in Firefox for Android were short-lived. This support, detailed on caniuse.com, shows version-specific compatibility. Note that my testing suggests Opera Mini and Opera Mobile support contradicts caniuse data.

Although the WHATWG specification documents inputmode, the W3C 5.2 spec omits it, hinting at potential obsolescence. However, given WHATWG documentation and browser support, we'll consider the WHATWG standard.

inputmode accepts several values:

none

This value prevents keyboard display in Chrome for Android, though iOS 12.2 shows its default keyboard. It's intended for inputs with custom keyboard controls.

numeric

Highly useful for numerical inputs (PINs, zip codes, etc.). Unlike type="number", it allows maxlength, minlength, and pattern attributes, enhancing versatility. While often used with type="tel", this is semantically incorrect. The pattern="\d*" attribute provides a similar effect but limits input strictly to numbers; Android doesn't allow switching to an alphanumeric keyboard, potentially blocking valid entries.

tel

Optimizes telephone number input. It provides a standard telephone keypad (0-9, #, *) with alphabetic mnemonics (ABC, DEF, etc.).

decimal

Produces a keyboard similar to tel on iOS, replacing the * # key with a decimal point. Android uses the standard numeric keyboard.

email

Includes the @ and . characters, improving email address entry. iOS's email suggestions might cause confusion. Useful for custom email validation.

url

Facilitates URL entry by including common web address characters (., /) and locale-specific TLDs. Use type="url" for input validation.

search

Displays a "Go" (iOS) or "Enter" (Android) key, ideal for search forms. type="search" offers alternative visual cues.

Additional Notes

  • Chromium-based Android browsers (Edge, Brave, Opera) mirror Chrome's inputmode behavior.
  • iPad and Android tablet behavior largely mirrors iPhone and Android phones, respectively, excluding third-party keyboards.
  • kana, katakana, and latin-name values from earlier specifications are no longer implemented. Interestingly, latin-name on iOS suggests the user's name.

Demo

A live demo showcasing these inputmode variations is available (link to be provided if a demo is created).

References

  • WHATWG specification
  • MDN documentation
  • caniuse.com
  • Chrome Platform Status (Chromium Ticket #244688)

위 내용은 입력 모드에 대해 알고 싶었던 모든 것의 상세 내용입니다. 자세한 내용은 PHP 중국어 웹사이트의 기타 관련 기사를 참조하세요!

본 웹사이트의 성명
본 글의 내용은 네티즌들의 자발적인 기여로 작성되었으며, 저작권은 원저작자에게 있습니다. 본 사이트는 이에 상응하는 법적 책임을 지지 않습니다. 표절이나 침해가 의심되는 콘텐츠를 발견한 경우 admin@php.cn으로 문의하세요.

핫 AI 도구

Undresser.AI Undress

Undresser.AI Undress

사실적인 누드 사진을 만들기 위한 AI 기반 앱

AI Clothes Remover

AI Clothes Remover

사진에서 옷을 제거하는 온라인 AI 도구입니다.

Undress AI Tool

Undress AI Tool

무료로 이미지를 벗다

Clothoff.io

Clothoff.io

AI 옷 제거제

Video Face Swap

Video Face Swap

완전히 무료인 AI 얼굴 교환 도구를 사용하여 모든 비디오의 얼굴을 쉽게 바꾸세요!

뜨거운 도구

메모장++7.3.1

메모장++7.3.1

사용하기 쉬운 무료 코드 편집기

SublimeText3 중국어 버전

SublimeText3 중국어 버전

중국어 버전, 사용하기 매우 쉽습니다.

스튜디오 13.0.1 보내기

스튜디오 13.0.1 보내기

강력한 PHP 통합 개발 환경

드림위버 CS6

드림위버 CS6

시각적 웹 개발 도구

SublimeText3 Mac 버전

SublimeText3 Mac 버전

신 수준의 코드 편집 소프트웨어(SublimeText3)

끈적 끈적한 포지셔닝 및 대시 Sass가있는 쌓인 카드 끈적 끈적한 포지셔닝 및 대시 Sass가있는 쌓인 카드 Apr 03, 2025 am 10:30 AM

다른 날, 나는 Corey Ginnivan의 웹 사이트에서 스크롤 할 때 카드 모음이 서로 쌓이는 것을 발견했습니다.

Google 글꼴 변수 글꼴 Google 글꼴 변수 글꼴 Apr 09, 2025 am 10:42 AM

Google Fonts가 새로운 디자인 (트윗)을 출시 한 것을 볼 수 있습니다. 마지막 큰 재 설계와 비교할 때 이것은 훨씬 더 반복적 인 느낌이 듭니다. 차이를 간신히 말할 수 있습니다

HTML, CSS 및 JavaScript로 애니메이션 카운트 다운 타이머를 만드는 방법 HTML, CSS 및 JavaScript로 애니메이션 카운트 다운 타이머를 만드는 방법 Apr 11, 2025 am 11:29 AM

프로젝트에 카운트 다운 타이머가 필요한 적이 있습니까? 그런 것은 플러그인에 도달하는 것이 당연하지만 실제로는 훨씬 더 많습니다.

HTML 데이터 속성 안내서 HTML 데이터 속성 안내서 Apr 11, 2025 am 11:50 AM

HTML, CSS 및 JavaScript의 데이터 속성에 대해 알고 싶었던 모든 것.

플렉스 레이아웃의 자주색 슬래시 영역이 잘못된 '오버플로 공간'으로 간주되는 이유는 무엇입니까? 플렉스 레이아웃의 자주색 슬래시 영역이 잘못된 '오버플로 공간'으로 간주되는 이유는 무엇입니까? Apr 05, 2025 pm 05:51 PM

플렉스 레이아웃의 보라색 슬래시 영역에 대한 질문 플렉스 레이아웃을 사용할 때 개발자 도구 (d ...)와 같은 혼란스러운 현상이 발생할 수 있습니다.

CSS를 통해 일류 이름 항목으로 자식 요소를 선택하는 방법은 무엇입니까? CSS를 통해 일류 이름 항목으로 자식 요소를 선택하는 방법은 무엇입니까? Apr 05, 2025 pm 11:24 PM

요소 수가 고정되지 않은 경우 CSS를 통해 지정된 클래스 이름의 첫 번째 자식 요소를 선택하는 방법. HTML 구조를 처리 할 때 종종 다른 요소를 만듭니다 ...

Sass를 더 빨리 만들기위한 개념 증명 Sass를 더 빨리 만들기위한 개념 증명 Apr 16, 2025 am 10:38 AM

새로운 프로젝트가 시작될 때, Sass 컴파일은 눈을 깜박이게합니다. 특히 BrowserSync와 짝을 이루는 경우 기분이 좋습니다.

See all articles