Bootstrap 中导航栏与 div.navbar 的区别 [英] Difference between nav vs div.navbar in Bootstrap
问题描述
一些 Bootstrap 的例子使用 div.navbar
来保持导航bar 和其他示例(例如,在 组件文档页面 中)使用 nav.navbar代码>.这两种方法有什么区别?是否有使用一种代替另一种的指南?
Some of Bootstrap's examples use div.navbar
to hold the navigation bar, and other examples (e.g., in the Components documentation page) use nav.navbar
. What is the difference between these two approaches? And are there guidelines for using one instead of the other?
推荐答案
两者都将输出相同的设计,但使用 nav
标签在方法上更具语义.它代表页面的主导航.使用导航标签有助于搜索引擎识别您在页面上的主要导航.可能还有其他链接,但您的顶部菜单是主菜单.希望这有帮助
Both will output same design but using nav
tag is more semantic in approach. It represents main navigation of your page. using nav tag helps search engine recognize which is your main navigation on the page. there might be other links too but your top menu is the main menu.
Hope this helps
这篇关于Bootstrap 中导航栏与 div.navbar 的区别的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!