首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >如何在元素上使用有声样式表?

如何在元素上使用有声样式表?
EN

Stack Overflow用户
提问于 2011-07-07 16:06:12
回答 1查看 1K关注 0票数 1

我在Firefox4和Safari上运行了下面的codes..When,我好像没有听到anything..How,我能解决这个问题吗?

代码语言:javascript
复制
 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Untitled Document</title>
<style type="text/css">
@media aural {
h1, h2, h3, 
h4, h5, h6    { voice-family: paul, male; stress: 20; richness: 90 }
h1            { pitch: x-low; pitch-range: 90 }
h2            { pitch: x-low; pitch-range: 80 }
h3            { pitch: low; pitch-range: 70 }
h4            { pitch: medium; pitch-range: 60 }
h5            { pitch: medium; pitch-range: 50 }
h6            { pitch: medium; pitch-range: 40 }
li, dt, dd    { pitch: medium; richness: 60 }
 dt            { stress: 80 }
pre, code, tt { pitch: medium; pitch-range: 0; stress: 0; richness: 80 }
em            { pitch: medium; pitch-range: 60; stress: 60; richness: 50 }
strong        { pitch: medium; pitch-range: 60; stress: 90; richness: 90 }
dfn           { pitch: high; pitch-range: 60; stress: 60 }
s, strike     { richness: 0 }
i             { pitch: medium; pitch-range: 60; stress: 60; richness: 50 }
b             { pitch: medium; pitch-range: 60; stress: 90; richness: 90 }
u             { richness: 0 }
 a:link        { voice-family: harry, male }
 a:visited     { voice-family: betty, female }
a:active      { voice-family: betty, female; pitch-range: 80; pitch: x-high }
}
</style>
</head>

<body>
<p id="a" class="heidi">Testing</p>
 <p id="b" class="peter">Testingb</p>
 <h2>Heading2</h2>
</body>
<html>
EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2011-07-07 16:20:23

有声样式表供屏幕阅读器读取(因此您在样式表开头看到的aural媒体类型),而不是供浏览器呈现。这就是为什么你的浏览器不会显示任何内容。

它们是为视觉有障碍的人提供的辅助工具,他们需要依靠听觉而不是视觉来阅读网站。

Aural style sheets在CSS2.1规范中进行了描述,但已被CSS3 Speech Module所取代。然而,由于大多数屏幕阅读器只是简单地读取浏览器呈现和显示的内容,因此还不知道对这两种规范都存在什么样的支持。

票数 14
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/6607571

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档