TE
科技回声
首页24小时热榜最新最佳问答展示工作
GitHubTwitter
首页

科技回声

基于 Next.js 构建的科技新闻平台,提供全球科技新闻和讨论内容。

GitHubTwitter

首页

首页最新最佳问答展示工作

资源链接

HackerNews API原版 HackerNewsNext.js

© 2025 科技回声. 版权所有。

Show HN: I wrote an article explaining why CSS should handle sound

3 点作者 tomaszs将近 4 年前

2 条评论

zzo38computer将近 4 年前
&quot;No, websites should not play sounds, it is annoying&quot; I have a somewhat different response to that. They are correct sounds can already be played. Supporting control in CSS (although I am not sure how) would allow the end user&#x27;s CSS to override it, as well as for alternate style sheets provided by the author to override it, so it is still useful. CSS media queries may also be available, such as mono&#x2F;stereo&#x2F;surround, which may also be useful.<p>My own ideas of a new web browser include meta-CSS that the end user can use (I have not yet defined the syntax of meta-CSS), as well as some new CSS commands, such as !priority; only values in a narrow range are allowed for !priority for document authors, while the end users may use values above and below that range too. If you simply want to mute all audio, maybe you can write:<p><pre><code> * { audio-volume: 0% !important !priority(255); } </code></pre> More complex preferences could also be defined using user CSS and meta-CSS.<p>So, yes, CSS for audio seems like it might be a good idea. However, the web browser will need to be designed with better user control of these things than many existing implementations tend to do.
john-doe将近 4 年前
Paywalled, couldn&#x27;t read. (a pity because I would have liked to)
评论 #27263183 未加载