国产av日韩一区二区三区精品,成人性爱视频在线观看,国产,欧美,日韩,一区,www.成色av久久成人,2222eeee成人天堂

目錄
none
numeric
tel
decimal
email
url
search
Additional Notes
Demo
References
首頁(yè) web前端 css教程 您想知道的有關(guān)輸入模式的一切

您想知道的有關(guān)輸入模式的一切

Apr 21, 2025 am 11:03 AM

您想知道的有關(guān)輸入模式的一切

inputmode屬性為觸摸屏設(shè)備上的瀏覽器提供了一個(gè)有價(jià)值的提示,從而指導(dǎo)它們選擇適當(dāng)?shù)钠聊绘I盤<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)

以上是您想知道的有關(guān)輸入模式的一切的詳細(xì)內(nèi)容。更多信息請(qǐng)關(guān)注PHP中文網(wǎng)其他相關(guān)文章!

本站聲明
本文內(nèi)容由網(wǎng)友自發(fā)貢獻(xiàn),版權(quán)歸原作者所有,本站不承擔(dān)相應(yīng)法律責(zé)任。如您發(fā)現(xiàn)有涉嫌抄襲侵權(quán)的內(nèi)容,請(qǐng)聯(lián)系admin@php.cn

熱AI工具

Undress AI Tool

Undress AI Tool

免費(fèi)脫衣服圖片

Undresser.AI Undress

Undresser.AI Undress

人工智能驅(qū)動(dòng)的應(yīng)用程序,用于創(chuàng)建逼真的裸體照片

AI Clothes Remover

AI Clothes Remover

用于從照片中去除衣服的在線人工智能工具。

Clothoff.io

Clothoff.io

AI脫衣機(jī)

Video Face Swap

Video Face Swap

使用我們完全免費(fèi)的人工智能換臉工具輕松在任何視頻中換臉!

熱工具

記事本++7.3.1

記事本++7.3.1

好用且免費(fèi)的代碼編輯器

SublimeText3漢化版

SublimeText3漢化版

中文版,非常好用

禪工作室 13.0.1

禪工作室 13.0.1

功能強(qiáng)大的PHP集成開(kāi)發(fā)環(huán)境

Dreamweaver CS6

Dreamweaver CS6

視覺(jué)化網(wǎng)頁(yè)開(kāi)發(fā)工具

SublimeText3 Mac版

SublimeText3 Mac版

神級(jí)代碼編輯軟件(SublimeText3)

什么是AutoPrefixer,它如何工作? 什么是AutoPrefixer,它如何工作? Jul 02, 2025 am 01:15 AM

Autoprefixer是一個(gè)根據(jù)目標(biāo)瀏覽器范圍自動(dòng)為CSS屬性添加廠商前綴的工具。1.它解決了手動(dòng)維護(hù)前綴易出錯(cuò)的問(wèn)題;2.通過(guò)PostCSS插件形式工作,解析CSS、分析需加前綴的屬性、依配置生成代碼;3.使用步驟包括安裝插件、設(shè)置browserslist、在構(gòu)建流程中啟用;4.注意事項(xiàng)有不手動(dòng)加前綴、保持配置更新、非所有屬性都加前綴、建議配合預(yù)處理器使用。

CSS教程,用于創(chuàng)建粘性標(biāo)頭或頁(yè)腳 CSS教程,用于創(chuàng)建粘性標(biāo)頭或頁(yè)腳 Jul 02, 2025 am 01:04 AM

TocreatestickyheadersandfooterswithCSS,useposition:stickyforheaderswithtopvalueandz-index,ensuringparentcontainersdon’trestrictit.1.Forstickyheaders:setposition:sticky,top:0,z-index,andbackgroundcolor.2.Forstickyfooters,betteruseposition:fixedwithbot

什么是圓錐級(jí)函數(shù)? 什么是圓錐級(jí)函數(shù)? Jul 01, 2025 am 01:16 AM

theconic-Gradient()functionIncsscreatesCircularGradientsThatRotateColorStopSaroundAcentralPoint.1.IsidealForPieCharts,ProgressIndicators,colordichers,colorwheels和decorativeBackgrounds.2.itworksbysbysbysbydefindefingincolordefingincolorstopsatspecificains off.

CSS自定義屬性的范圍是什么? CSS自定義屬性的范圍是什么? Jun 25, 2025 am 12:16 AM

CSS自定義屬性的作用域取決于其聲明的上下文,全局變量通常定義在:root中,而局部變量則定義在特定選擇器內(nèi),以便組件化和隔離樣式。例如,定義在.card類中的變量?jī)H對(duì)匹配該類的元素及其子元素可用。最佳實(shí)踐包括:1.使用:root定義全局變量如主題色;2.在組件內(nèi)部定義局部變量以實(shí)現(xiàn)封裝;3.避免重復(fù)聲明同一變量;4.注意選擇器特異性可能引發(fā)的覆蓋問(wèn)題。此外,CSS變量區(qū)分大小寫,且應(yīng)在使用前定義以避免錯(cuò)誤。若變量未定義或引用失敗,則會(huì)采用回退值或默認(rèn)值initial。調(diào)試時(shí)可通過(guò)瀏覽器開(kāi)發(fā)者工

CSS教程專注于移動(dòng)優(yōu)先設(shè)計(jì) CSS教程專注于移動(dòng)優(yōu)先設(shè)計(jì) Jul 02, 2025 am 12:52 AM

Mobile-firstCSSdesignrequiressettingtheviewportmetatag,usingrelativeunits,stylingfromsmallscreensup,optimizingtypographyandtouchtargets.First,addtocontrolscaling.Second,use%,em,orreminsteadofpixelsforflexiblelayouts.Third,writebasestylesformobile,the

CSS教程,用于創(chuàng)建加載旋轉(zhuǎn)器和動(dòng)畫 CSS教程,用于創(chuàng)建加載旋轉(zhuǎn)器和動(dòng)畫 Jul 07, 2025 am 12:07 AM

創(chuàng)建CSS加載旋轉(zhuǎn)器的方法有三種:1.使用邊框的基本旋轉(zhuǎn)器,通過(guò)HTML和CSS實(shí)現(xiàn)簡(jiǎn)單動(dòng)畫;2.使用多個(gè)點(diǎn)的自定義旋轉(zhuǎn)器,通過(guò)不同延遲時(shí)間實(shí)現(xiàn)跳動(dòng)效果;3.在按鈕中添加旋轉(zhuǎn)器,通過(guò)JavaScript切換類來(lái)顯示加載狀態(tài)。每種方法都強(qiáng)調(diào)了設(shè)計(jì)細(xì)節(jié)如顏色、大小、可訪問(wèn)性和性能優(yōu)化的重要性,以提升用戶體驗(yàn)。

如何將整個(gè)網(wǎng)格集中在視口中? 如何將整個(gè)網(wǎng)格集中在視口中? Jul 02, 2025 am 12:53 AM

要讓整個(gè)網(wǎng)格布局在視口中居中顯示,可通過(guò)以下方法實(shí)現(xiàn):1.使用margin:0auto實(shí)現(xiàn)水平居中,需設(shè)定容器固定寬度,適用于固定布局;2.利用Flexbox在外層容器設(shè)置justify-content和align-items屬性,結(jié)合min-height:100vh可實(shí)現(xiàn)垂直和水平居中,適合全屏展示場(chǎng)景;3.直接使用CSSGrid的place-items屬性在父容器上快速居中,簡(jiǎn)潔且現(xiàn)代瀏覽器支持良好,同時(shí)需確保父容器有足夠高度。每種方式均有適用場(chǎng)景和限制,根據(jù)實(shí)際需求選擇合適的方案即可。

如何創(chuàng)建本質(zhì)上響應(yīng)的網(wǎng)格布局? 如何創(chuàng)建本質(zhì)上響應(yīng)的網(wǎng)格布局? Jul 02, 2025 am 01:19 AM

要?jiǎng)?chuàng)建內(nèi)在響應(yīng)式網(wǎng)格布局,核心方法是使用CSSGrid的repeat(auto-fit,minmax())模式;1.設(shè)置grid-template-columns:repeat(auto-fit,minmax(200px,1fr))讓瀏覽器自動(dòng)調(diào)整列數(shù)并限制每列最小和最大寬度;2.使用gap控制格子間距;3.容器應(yīng)設(shè)為相對(duì)單位如width:100%、配合box-sizing:border-box避免寬度計(jì)算錯(cuò)誤并用margin:auto居中;4.可選設(shè)置行高與內(nèi)容對(duì)齊方式提升視覺(jué)一致性,如row

See all articles