久久久久久久av_日韩在线中文_看一级毛片视频_日本精品二区_成人深夜福利视频_武道仙尊动漫在线观看

為什么不鼓勵(lì)按鈕導(dǎo)航?

Why are button#39;s discouraged from navigation?(為什么不鼓勵(lì)按鈕導(dǎo)航?)
本文介紹了為什么不鼓勵(lì)按鈕導(dǎo)航?的處理方法,對(duì)大家解決問題具有一定的參考價(jià)值,需要的朋友們下面隨著小編來一起學(xué)習(xí)吧!

問題描述

這可能是一個(gè)固執(zhí)己見的問題,但我環(huán)顧網(wǎng)絡(luò),似乎網(wǎng)絡(luò)開發(fā)人員喜歡將 <a> 標(biāo)記設(shè)置為看起來像按鈕,而不是使用特定的 <按鈕>標(biāo)簽.我在查看導(dǎo)航時(shí)明顯看到了這一點(diǎn)

This may be an opinionated question, but I was looking around the web and it seems like web developers like to style <a> tags to look like buttons, rather than use a specific <button> tag. I've noticeably seen this when looking at navigations

經(jīng)過一番研究,我發(fā)現(xiàn)了這個(gè):

After a bit of research, I found this:

  • 按鈕不適合搜索,因?yàn)槠渲械奈谋緦?duì)搜索引擎是不可見的.
  • 按鈕比鏈接更難更新,每次更新都需要 Photoshop 和新圖片.
  • 按鈕加載速度比鏈接慢,這對(duì)移動(dòng)訪問者尤其不利.
  • 視覺障礙者不太容易使用按鈕.
  • 按鈕是不必要的,即使你想使用非標(biāo)準(zhǔn)字體,這要?dú)w功于 TypeKit 等工具.~ 引用自這里

但是,這些原因"中的大多數(shù)似乎都非常站不住腳,并且您需要 photoshop"之類的答案似乎……嗯……無效?

However, most of these 'reasons' seems quite flimsy and answers like 'you need photoshop' seem... well... invalid?

所以我想知道:

在創(chuàng)建導(dǎo)航菜單時(shí)不使用 <button> 標(biāo)簽是否有實(shí)際原因,而是將 <a> 標(biāo)簽設(shè)置為看起來像按鈕?為什么按鈕不是常態(tài)?這不是他們的目的嗎?

Is there an actual reason why the <button> tags aren't used when creating navigation menus, and instead style <a> tags to look like buttons? Why aren't buttons the norm? Is this not what they're made for?

* 我不希望你在這里發(fā)表意見,也不希望有觀點(diǎn).僅關(guān)于為什么會(huì)這樣的事實(shí)信息

推薦答案

閱讀了評(píng)論中發(fā)布的多個(gè)文檔后,似乎確實(shí)有一個(gè)明確的事實(shí)原因按鈕沒有使用導(dǎo)航欄.

After reading up on multiple documents posted in the comments, it seems that there is actually a clear factual reason buttons are not used in navigation bars.

當(dāng)存在頁面重定向或?qū)⒂脩魩У骄W(wǎng)站的其他位置時(shí)使用這些.

These are used when there is a page redirect or taking a user elsewhere on the website.

  • 如果它導(dǎo)航,它就是一個(gè)鏈接.使用具有有效超文本引用的鏈接標(biāo)記

~鏈接不是按鈕

按鈕元素

當(dāng)您想要doSomething() 重定向用戶時(shí)使用這些.IE.提交表單/等.

Button elements

These are used when you want to doSomething() that is not redirecting the user. I.e. submitting a form / etc.

你需要問自己的問題是:

The question you need to ask yourself is:

此控件是否用于啟動(dòng)即時(shí)操作該操作是導(dǎo)航到另一個(gè)頁面嗎?

Will this control be used to initiate an immediate action or Is the action to navigate to another page?

如果您的問題的答案是第一部分,那么您應(yīng)該使用 button 元素.而如果您希望使用后者,那么您應(yīng)該使用 a 元素.

if the answer to your question is the first part, then you should be using a button element. Whereas if it is the latter that you are wishing to do, then you should be using an a element.

進(jìn)一步閱讀:

  • w3.org

鏈接不是按鈕.DIV 和 SPAN 也不是

何時(shí)使用按鈕元素

這篇關(guān)于為什么不鼓勵(lì)按鈕導(dǎo)航?的文章就介紹到這了,希望我們推薦的答案對(duì)大家有所幫助,也希望大家多多支持html5模板網(wǎng)!

【網(wǎng)站聲明】本站部分內(nèi)容來源于互聯(lián)網(wǎng),旨在幫助大家更快的解決問題,如果有圖片或者內(nèi)容侵犯了您的權(quán)益,請(qǐng)聯(lián)系我們刪除處理,感謝您的支持!

相關(guān)文檔推薦

How to check for duplicate CSS rules?(如何檢查重復(fù)的 CSS 規(guī)則?)
Remove duplicate CSS declarations across multiple files(刪除多個(gè)文件中的重復(fù) CSS 聲明)
How can I duplicate a div onclick event?(如何復(fù)制 div onclick 事件?)
opening html from google drive(從谷歌驅(qū)動(dòng)器打開 html)
How to embed videos from Google drive to webpage?(如何將視頻從 Google 驅(qū)動(dòng)器嵌入到網(wǎng)頁?)
How to view Google drive pdf link in iframe(如何在 iframe 中查看 Google Drive pdf 鏈接)
主站蜘蛛池模板: 国产精品18hdxxxⅹ在线 | 欧美日韩在线视频一区二区 | 一道本视频 | 91久久精品一区二区二区 | 一区二区在线不卡 | 日本在线视频不卡 | 免费看黄色视屏 | 91玖玖| 日韩二三区 | 日韩欧美成人一区二区三区 | 亚洲精品成人网 | 国产精品久久久久久久久久久久久久 | 国产在线一区二区 | 麻豆视频在线免费观看 | 天天插天天射天天干 | 亚洲视频一区在线 | 欧美黄色网 | 久久成人精品视频 | 亚洲91精品| 在线观看h视频 | av一二三四| 国产精品一区二区免费看 | 日韩欧美一区在线 | 99久久日韩精品免费热麻豆美女 | 一区二区三区小视频 | 国产精品99久久久久久宅男 | 国产高清亚洲 | 久草电影网| 欧美在线色 | 久久一二 | 国产伦精品一区二区三区四区视频 | 亚洲精品二区 | 天天操狠狠操 | 五月天婷婷久久 | www.久草 | 天天操综合网 | 亚洲欧美国产精品久久 | 一区二区三区四区国产 | 成年人在线视频 | 91视频在线 | 91精品国产色综合久久 |