html 突出显示选项卡:版本2

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了html 突出显示选项卡:版本2相关的知识,希望对你有一定的参考价值。

# In the page front matter we set the page id:

---
layout: default
title: Our artists
id: artists
---
// And finally a bit of jQuery to set the active link:

// highlight current page
var currentPage = $("body").data("current-page");
if (currentPage) {
  $("a[data-page-id='" + currentPage + "']").addClass("active");
}
<!--
My approach is to define a custom variable in the YAML front matter of the page and output this on the <body> element:
-->

<body{% if page.id %} data-current-page="{{ page.id }}"{% endif %}>

<!--
My navigation links include the identifier of the page that they link to:
-->

<nav>
  <ul>
    <li><a href="artists.html" data-page-id="artists">artists</a></li>
    <li><a href="#" data-page-id="contact">contact</a></li>
    <li><a href="#" data-page-id="about">about</a></li>
  </ul>
</nav>

以上是关于html 突出显示选项卡:版本2的主要内容,如果未能解决你的问题,请参考以下文章

html 突出显示选项卡:版本4

html 突出显示选项卡:版本3

html 突出显示选项卡:版本1

更改 UIPicker 突出显示的选项卡宽度

CSS 突出显示活动选项卡

如何在适当的选项卡中保持突出显示?