列表中链接的规范结构? [英] the canonical structure of links in lists?

查看:50
本文介绍了列表中链接的规范结构?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

某人认为这种格式是可以接受的:


< ul>

< a href =" http://foo.com" ;>< li> Foo< / a>

< a href =" http://bar.com">< li> Bar< / a>

< / ul>


这种情况​​恰好无法在KHTML中正确显示,即Konqueror和

可能是Safari。


我建议应该如此:


< ul>

< li>< a href =" http ://foo.com"> Foo< / a>

< li>< a href =" http://bar.com"> Bar< / a>

< / ul>


他不同意。


是否有任何技术理由要求后者为前者?


..................................... ...............................

通过TITANnews发布 - 未经审查的新闻组访问

A certain person thinks this format is acceptable:

<ul>
<a href="http://foo.com"><li>Foo</a>
<a href="http://bar.com"><li>Bar</a>
</ul>

This happens to fail to display properly in KHTML, i.e. Konqueror and
probably Safari.

I suggest it should be thus:

<ul>
<li><a href="http://foo.com">Foo</a>
<li><a href="http://bar.com">Bar</a>
</ul>

He disagrees.

Is there any technical reason to prefer the latter to the former?

.................................................. ...............
Posted via TITANnews - Uncensored Newsgroups Access

at http://www.TitanNews.com <<<<
at http://www.TitanNews.com <<<<



- =每个新闻组 - 匿名,无保留,宽带下载= -


-=Every Newsgroup - Anonymous, UNCENSORED, BROADBAND Downloads=-

推荐答案

"福雷斯特"写道:
"Forrest" wrote:
[Re"< ul>< a href =" http://foo.com">< li> Foo< / a> .. 。"
vs."< ul>< li>< a href =" http://foo.com"> Foo< / a> ..."]

有没有技术上的理由让后者更喜欢前者?
[Re "<ul><a href="http://foo.com"><li>Foo</a>..."
vs. "<ul><li><a href="http://foo.com">Foo</a>..."]

Is there any technical reason to prefer the latter to the former?




根据HTML DTD(文档类型定义),UL元素只能

包含一个或多个LI元素,而LI元素可以包含块和内联元素的
(这是%flow表示的)


<!ELEMENT UL - - (LI)+ - 无序列表 - >

<!ELEMENT LI - O(%流量;) * - 列表项 - >


这意味着超链接应该在*里面* LI元素(即

"< li> ;< a>",not"< a>< li>"(隐含关闭&q​​uot;< / li>"标记)。


-

phil [dot] ronan @ virgin [dot] net
http://vzone.virgin.net /phil.ronan/


Forrest写道:
Forrest wrote:

某人认为这种格式是可以接受的:

< ul>
< a href =" http://foo.com">< li> Foo< / a>
< a href =" ; http://bar.com">< li> Bar< / a>
< / ul>

这种情况在KHTML中无法正常显示,即Konqueror和
可能是Safari。

我建议应该如此:

< ul>
< li>< a href =" http ://foo.com"> Foo< / a>
< li>< a href =" http://bar.com"> Bar< / a>
< / ul>

他不同意。

是否有任何技术理由偏爱后者?

A certain person thinks this format is acceptable:

<ul>
<a href="http://foo.com"><li>Foo</a>
<a href="http://bar.com"><li>Bar</a>
</ul>

This happens to fail to display properly in KHTML, i.e. Konqueror and
probably Safari.

I suggest it should be thus:

<ul>
<li><a href="http://foo.com">Foo</a>
<li><a href="http://bar.com">Bar</a>
</ul>

He disagrees.

Is there any technical reason to prefer the latter to the former?




让此人完成页面。然后让他或她在< URL:http://validator.w3.org/>进行测试

。这可以通过上传本地文件的
来完成;它不必安装在Web服务器上。


顺便说一下,由于Safari使用基于Gecko的HTML引擎,任何

问题Safari也可能影响Mozilla和Firefox。


-


David E. Ross

<网址:http://www.rossde.com/>


我使用Mozilla作为我的网络浏览器,因为我想要一个符合Web的浏览器

标准。请参阅< URL:http://www.mozilla.org/>。



Have this person complete the page. Then have him or her test it
at <URL:http://validator.w3.org/>. This can be done via an upload
of a local file; it doesn''t have to be installed on a Web server.

By the way, since Safari uses an HTML engine based on Gecko, any
problem with Safari likely affects Mozilla and Firefox, too.

--

David E. Ross
<URL:http://www.rossde.com/>

I use Mozilla as my Web browser because I want a browser that
complies with Web standards. See <URL:http://www.mozilla.org/>.


David Ross< no **** @ nowhere.not>写道:
David Ross <no****@nowhere.not> wrote:
顺便说一下,由于Safari使用基于Gecko的HTML引擎
By the way, since Safari uses an HTML engine based on Gecko




错误,Safari基于KHTML。


-

Spartanicus



Wrong, Safari is KHTML based.

--
Spartanicus


这篇关于列表中链接的规范结构?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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