博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
[HTML5] Add Semantic Styling to the Current Page of a Navigation Item with aria-current
阅读量:4983 次
发布时间:2019-06-12

本文共 1163 字,大约阅读时间需要 3 分钟。

In this lesson, we are going to use aria-current to give a screen reader user more context about what the current page is. Historically, many developers use an .active class to indicate that the page in a menu is the same that you're on.

Instead of using a class, we are going to use the aria-current attribute to add more semantic value to the HTML and use that attribute to style the active link.

Note: VoiceOver testing works best on the Native Safari Browser, hence why we should always use Safari to test.

More resources:

 

.menu {
display: flex; padding: 0; list-style: none; .menu__link { display: inline-block; position: relative; text-transform: uppercase; font-weight: bold; color: #6505cc; padding: 0.675rem; margin: 0 0.5rem; font-size: 1.5rem; text-decoration: none; &[aria-current="page"] { border-bottom: 8px solid #6505cc; } }}

 

转载于:https://www.cnblogs.com/Answer1215/p/11347719.html

你可能感兴趣的文章
笔记:git基本操作
查看>>
【MemSQL Start[c]UP 3.0 - Round 1 C】 Pie Rules
查看>>
Ognl中“%”、“#”、“$”详解
查看>>
我对应用软件——美团的看法
查看>>
python第六篇文件处理类型
查看>>
向量非零元素个数_向量范数详解+代码实现
查看>>
LeetCode 题解之Add Digits
查看>>
hdu1502 , Regular Words, dp,高精度加法
查看>>
iOS 电话在后台运行时,我的启动图片被压缩
查看>>
js --基本语法3 函数,数组,堆棧
查看>>
Oracle 数据库导入、导出
查看>>
批量修改 表结构
查看>>
MySQL的btree索引和hash索引的区别
查看>>
抽象类和接口有什么区别
查看>>
wc2018
查看>>
[转载] 杜拉拉升职记——01 忠诚源于满足
查看>>
那些mv*框架如何选择
查看>>
git工作流程
查看>>
Excel坐标自动在AutoCad绘图_3
查看>>
hacknet
查看>>