xhtml中的图片标题 [英] image caption in xhtml

查看:62
本文介绍了xhtml中的图片标题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在xhtml中为图片附加标题的最佳方法是什么?


我可以通过< caption>附加表格的标题。标签

但是我想做一个类似于图像的东西。

如何以自然的方式做到这一点?

-tt。

What is the best way to attach a caption to an image in xhtml?

I can attach a caption to a table by a "<caption>" tag
but I would like to do sth similar to an image.
How to do it in a natural way?
-tt.

推荐答案

Tomek Toczyski< gu*@kajak.org.pl>写道:
Tomek Toczyski <gu*@kajak.org.pl> wrote:
在xhtml中为图像附加标题的最佳方法是什么?


首先,至少忘记XHTML。

我可以通过< caption>附加表格的标题。标签
但是我想做一个类似于图像的文件。
如何以自然的方式做到这一点?
What is the best way to attach a caption to an image in xhtml?
First, forget XHTML, for now at least.
I can attach a caption to a table by a "<caption>" tag
but I would like to do sth similar to an image.
How to do it in a natural way?




没有自然的因为没有为此目的设计HTML标记。

例如,您可以将标题放入< div>元素之后

< img>元素并使用CSS来设置它的样式。有关此选项和其他选项,请参阅
http: //www.cs.tut.fi/~jkorpela/www/captions.html

-

Yucca, http://www.cs.tut.fi/~jkorpela/

有关网页制作的网页: http:// www .cs.tut.fi / ~jkorpela / www.html



There is no natural way, since no HTML markup was designed for the purpose.
You could, for example, just put the caption into a <div> element after the
<img> element and use CSS to style it. For this and other options, see
http://www.cs.tut.fi/~jkorpela/www/captions.html

--
Yucca, http://www.cs.tut.fi/~jkorpela/
Pages about Web authoring: http://www.cs.tut.fi/~jkorpela/www.html


Tomek Toczyski< gu*@kajak.org.pl>写道:
Tomek Toczyski <gu*@kajak.org.pl> wrote:
在xhtml中为图像附加标题的最佳方法是什么?


我建议放弃比无用的XHTML愚蠢更糟糕的使用

HTML 4.01严格。

我可以附加一个通过< caption>排除表格的标题标签
但是我想做一个类似于图像的文件。
如何以自然的方式做到这一点?
What is the best way to attach a caption to an image in xhtml?
I''d recommend dropping the worse than useless XHTML silliness and use
HTML 4.01 Strict.
I can attach a caption to a table by a "<caption>" tag
but I would like to do sth similar to an image.
How to do it in a natural way?




简答:< ; p>< img ... alt ="合适的替代内容">< br>标题< / p>


答案很长:

有3种情况,其中image&标题标记很重要:搜索

引擎索引,视觉非CSS渲染和听觉渲染。

从SE角度来看:如果使用Google Image搜索图像

搜索服务你会发现它根据周围的

文本内容找到图像。人们普遍认为谷歌会忽略替代内容

,除非图像是链接的,看过图像产生的图像。
Google图片搜索我得出的结论是,这不是不对。与

其他SE索引方法一样,SE如何处理alt内容以及SE如何将周围的文本内容链接到图像是未知的并且受制于

基于实证结果的猜测。除非你有充分的理由要优先考虑SE索引,否则我会走高端路线并忽略SE图像&

标题索引怪癖并选择基于其他标记的标记因素。


从非CSS情境的视觉渲染角度和

a理论听觉渲染视角包装图像和标题
$ b段落元素中的$ b(如上面的简短回答所示)是适当的
。在视觉非CSS渲染情况下,图像和

标题可以呈现相邻,而组合将与其他内容分开。在听觉渲染图像&标题

组合应该呈现前导和尾随暂停。


从实际的听觉渲染角度来看:

的听觉我只熟悉Opera的渲染器渲染图像&

标题组合标记为一个带有前导和尾随

暂停的段落。 AT的听觉渲染器我的IBM主页配置*

Reader(3.04)渲染它没有可辨别的暂停,Jaws(6)前缀

渲染alt内容图像,Jaws也呈现没有

可辨别的前导或尾随暂停。但由于它的图像而前缀

结果看起来相当合理。


*是否完全呈现alt内容可以同时配置

in HPR和大白鲨。


-

Spartanicus



Short answer: <p><img ... alt="Suitable alt content"><br>Caption</p>

Long answer:

There are 3 situations where image & caption markup matters: Search
Engine indexing, visual non CSS rendering and aural rendering.

From a SE perspective: if you search for images with the Google Image
Search service you''ll notice that it finds images based on surrounding
textual content. It''s commonly thought that Google ignores alt content
unless the image is linked, having looked at the images produced by a
Google Images Search I have concluded that this isn''t correct. As with
other SE indexing methods, both how SEs treat alt content and how SEs
links surrounding textual content to an image is unknown and subject to
speculation based on empirical results. Unless you have a good reason to
prioritize SE indexing, I''d take the high road and ignore SE image &
caption indexing quirks and choose markup based on other factors.

Both from a visual rendering perspective in a non CSS situation and from
a theoretical aural rendering perspective wrapping the image and caption
in a paragraph element (as shown in the short answer above) is
appropriate. In a visual non CSS rendering situation the image and
caption can be expected to render adjacent whilst the combo will be
separate from other content. In aural rendering the image & caption
combo should be rendered with a leading and trailing pause.

From a practical aural rendering perspective:
Of the aural renderers that I''m familiar with only Opera renders image &
caption combos marked up as a paragraph with a leading and trailing
pause. Of the AT aural renderers my configuration* of IBM Homepage
Reader (3.04) renders it with no discernable pauses, Jaws (6) prefixes
the rendering of the alt content with "image", Jaws also renders with no
discernable leading or trailing pause. But due to it''s "image" prefix
the result appears fairly logical.

* Whether or not alt content is rendered at all can be configured both
in HPR and Jaws.

--
Spartanicus


Spartanicus:
Spartanicus:
我建议放弃比无用的XHTML愚蠢更糟糕的使用
HTML 4.01 Strict。
I''d recommend dropping the worse than useless XHTML silliness and use
HTML 4.01 Strict.




为什么? HTML4.01优于XHTML的优点是什么?


我喜欢XHTML,因为它更优雅,而且我认为将来可以重复使用更多



------


感谢您和Yucca的回答。


-tt。



Why? What are the advantages of HTML4.01 over XHTML?

I like XHTML because it is more elegant and I think it will be more
reusable in the future.
------

Thank you and Yucca for your answers.

-tt.


这篇关于xhtml中的图片标题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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