可访问性 - 使用< P> [英] accessibility - the use of <P>

查看:63
本文介绍了可访问性 - 使用< P>的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

从辅助功能的角度来看,使用< P>

超过< br>?


是否有任何优势,例如,是什么这两个例子之间的区别是,它们都可以获得吗?


例如。 1

< p>我的第一段。< / p>

< p>我的第二段。< / p>

例如。 2

< br>< br>我的第一段。

< br>< br>我的第二段。


谢谢


Chris

-


互动设计师 - SplashMedia
http://splashmedia.co.nz

解决方案

Chris Goldie写道:

从可访问性的角度来看,使用< P>
over< br>?是否有任何优势?

例如,这两个例子的区别是什么,它们都可以访问吗?

例如。 1
< p>我的第一段。< / p>
< p>我的第二段。< / p>

例如。 2
< br>< br>我的第一段。
< br>< br>我的第二段。




后一个MEANS我的第一段我的第二段


前MEANS我的第一段


我的第二段


a屏幕阅读器应该这样渲染它们,所以你想要的意思将会丢失



非视觉用途的网站后者可能会令人困惑,因此不应该使用
...< p>< / p>将内容显示为单个

段......这是一个概念性的想法,而不仅仅是文本

如何在页面上直观呈现


-

eric
www.ericjarvis.co.uk

嘿Lord不问我问题

我没有回答


Chris Goldie写道:

例如。 1
< p>我的第一段。< / p>
< p>我的第二段。< / p>

例如。 2
< br>< br>我的第一段。
< br>< br>我的第二段。




我我对网站的可访问性问题并不过分了解,但是我不会说b $ b确实要说两者在视觉上看起来都是段落,

默认情况下,前者通常是比后者更好的练习。


HTML元素的存在是为了向计算机描述它们的内容是什么。在您的第一个示例中,您有两个段落元素,

告诉计算机一些关于

文档结构的事情。在第二个例子中,你有一些带有

换行元素的任意文本,它没有提供关于

文本的任何有用信息。


在某些情况下,后者甚至可能是无效代码 - HTML 4.01

Strict和XHTML不允许BODY元素中的字符数据,所以

无论如何,你最终会将文本包装在其他元素中。为什么不使用

正确的?


9月13日星期六,Chris Goldie刻在永恒的卷轴上:

例如。 2
< br>< br>我的第一段。
< br>< br>我的第二段。




Er不,不。你告诉HTML他们不是段落。现在你正在尝试

告诉_us_他们_are_段落。


有一个古老的格言,归功于Henry Spencer:如果你撒谎到

编译器,它会得到它的复仇;并且必须更强大地应用于HTML,您甚至可以___控制用户将应用于您的标记的HTML

渲染代理,而不是

会对您在程序源上使用的编译器进行处理

代码。


多年来它一直是虽然流行的浏览器

(又名Mosaic-spawn)处理过< br>作为一种命令向下移动

一行,还有其他浏览器将其理解为HTML规范中定义的

换行符。一旦一条线被打破了,b $ b被破坏了,它就会被打破,所以填充额外的< br>标签对它们没有

的影响:无论连续多少< br>他们得到了,他们

只是产生一个换行符,然后继续在

后立即渲染。


以示例为例HTML4.01中的定义:


| BR元素强行中断(结束)当前文本行。


使用第二个br在< br>< br>那里_is_没有当前的文字行

要被打破,所以我认为说明这种行为是不公平的。

未定义。


From an accessibility point of view, is there any advange in using <P>
over <br>?

eg, whats the difference between these two examples, are they both
accessible?

Eg. 1
<p>My first paragraph.</p>
<p>My second paragraph.</p>

Eg. 2
<br><br>My first paragraph.
<br><br>My second paragraph.

Thanks

Chris
--

Interaction Designer - SplashMedia
http://splashmedia.co.nz

解决方案

Chris Goldie wrote:

From an accessibility point of view, is there any advange in using <P>
over <br>?

eg, whats the difference between these two examples, are they both
accessible?

Eg. 1
<p>My first paragraph.</p>
<p>My second paragraph.</p>

Eg. 2
<br><br>My first paragraph.
<br><br>My second paragraph.



the latter MEANS "My first paragraph My second paragraph

the former MEANS "My first paragraph

My second paragraph"

a screen reader should render them as such, so your intended meaning will
be lost

for non visual usage of the site the latter could be confusing and should
therefore not be used...<p></p> shows the content to be a single
paragraph...this is a conceptual idea not merely a matter of how the text
is visually represented on the page

--
eric
www.ericjarvis.co.uk
"Hey Lord don''t ask me questions
There ain''t no answer in me"


Chris Goldie wrote:

Eg. 1
<p>My first paragraph.</p>
<p>My second paragraph.</p>

Eg. 2
<br><br>My first paragraph.
<br><br>My second paragraph.



I''m not overly knowledgable about website accessibility issues, but I
do have to say that while both will visually appear to be paragraphs,
by default, the former is generally better practice than the latter.

HTML elements exist to describe to the computer what the contents of
them are. In your first example, you have two "paragraph" elements,
which tells the computer some things about the structure of the
document. In the second example, you have some arbitrary text with
line break elements, which doesn''t provide any useful information about
the text.

In certain contexts the latter may even be invalid code -- HTML 4.01
Strict and XHTML do not permit character data in the BODY element, so
you''d end up wrapping the text in other elements anyways. Why not use
the right ones?


On Sat, Sep 13, Chris Goldie inscribed on the eternal scroll:

Eg. 2
<br><br>My first paragraph.
<br><br>My second paragraph.



Er, no. You have told HTML they aren''t paragraphs. Now you''re trying
to tell _us_ that they _are_ paragraphs.

There''s an old dictum, attributed to Henry Spencer: "If you lie to the
compiler, it will get its revenge"; and that has to apply even more
strongly to HTML, where you have even _less_ control over which HTML
rendering agent your users will be applying to your markup, than you
would have had over which compilers you used on your program source
code.

For many years it''s been the case that although popular browsers
(a.k.a "Mosaic-spawn") treated <br> as a sort of command "move down by
one line", there were other browsers which understood it to be a
line-break as defined in HTML specifications. And once a line has
been broken, it''s broken, so stuffing-in additional <br> tags had no
effect on them: no matter how many successive <br> they got, they
simply produced one line break, and continued rendering on the
immediately following line.

Take for example the definition in HTML4.01:

| The BR element forcibly breaks (ends) the current line of text.

With the second "br" in <br><br> there _is_ no "current line of text"
to be broken, so I think it''s fair to state that the behaviour is
undefined.


这篇关于可访问性 - 使用&lt; P&gt;的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆