链接到其他网页 [英] Linking to other web pages

查看:83
本文介绍了链接到其他网页的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述




使用< a href =" /foldername/otherpage.html">

之间的区别是什么?双引号)和< a href =''/ foldername / otherpage.html''>(单引号)?


谢谢,

J.克里斯托弗

Hi,

What''s the difference between using <a href="/foldername/otherpage.html">
(double quotes) and <a href=''/foldername/otherpage.html''>(single quotes)?

Thanks,
J. Christopher

推荐答案

" J.克里斯托弗米勒 <第******* @ earthlink.net>写在

新闻:M5 ***************** @ newsread2.news.pas.earthl ink.net:
"J. Christopher Miller" <th*******@earthlink.net> wrote in
news:M5*****************@newsread2.news.pas.earthl ink.net:


使用< a href =" /foldername/otherpage.html">
(双引号)和< a之间的区别是什么? href =''/ foldername / otherpage.html''>(单引号)?
Hi,

What''s the difference between using <a href="/foldername/otherpage.html">
(double quotes) and <a href=''/foldername/otherpage.html''>(single quotes)?




无论如何。您可以在属性值周围使用任一类型的引用

(只要开始和结束引用都是相同的类型)。那是'

所以如果由于某种原因,属性值必须包含一个类型的引用

字符,你可以使用另一种类型来包围它(注意

引用所有属性值是个好主意;在XHTML中你没有选择

但是这样做;在HTML中有一些情况下你可以省略

报价,但它们不值得记忆)。



None whatsoever. You can use either type of quote around attribute values
(as long as both the opening and closing quote are the same type). That''s
so that if, for some reason, the attribute value has to contain a quote
character of one type, you can use the other type to surround it (note that
it''s a good idea to quote all attribute values; in XHTML you have no choice
but to do so; in HTML there are a few circumstances where you can omit the
quotes, but they''re not worth memorizing).




" Eric Bohlman" < EB ****** @ earthlink.net>在消息中写道

news:Xn ****************************** @ 130.133.1.4。 ..

"Eric Bohlman" <eb******@earthlink.net> wrote in message
news:Xn******************************@130.133.1.4. ..
" J.克里斯托弗米勒 <第******* @ earthlink.net>在
新闻中写道:M5 ***************** @ newsread2.news.pas.earthl ink.net:
"J. Christopher Miller" <th*******@earthlink.net> wrote in
news:M5*****************@newsread2.news.pas.earthl ink.net:


使用< a
href =" /foldername/otherpage.html">之间的区别是什么? (双引号)和< a href =''/ foldername / otherpage.html''>(单个
Hi,

What''s the difference between using <a href="/foldername/otherpage.html"> (double quotes) and <a href=''/foldername/otherpage.html''>(single


引号)?
无论如何。您可以在属性值周围使用任一类型的引用
(只要开始和结束引用都是相同的类型)。那是'
所以如果由于某种原因,属性值必须包含一种类型的引用
字符,你可以使用另一种类型来包围它

quotes)?
None whatsoever. You can use either type of quote around attribute values
(as long as both the opening and closing quote are the same type). That''s
so that if, for some reason, the attribute value has to contain a quote
character of one type, you can use the other type to surround it




....虽然这是为了方便,因为你也可以用实体引用(& quot;)或字符代码代替

。 br />



.... though that''s for sheer convenience, since you can also just substitute
an entity reference (&quot;) or a character code.


" Harlan Messinger" < H ********* @ comcast.net> schrieb im Newsbeitrag

新闻:c2 ************* @ ID-114100.news.uni-berlin.de ...
"Harlan Messinger" <h.*********@comcast.net> schrieb im Newsbeitrag
news:c2*************@ID-114100.news.uni-berlin.de...

Eric Bohlman < EB ****** @ earthlink.net>在消息中写道
新闻:Xn ****************************** @ 130.133.1.4。 ..

"Eric Bohlman" <eb******@earthlink.net> wrote in message
news:Xn******************************@130.133.1.4. ..
" J.克里斯托弗米勒 <第******* @ earthlink.net>在
新闻中写道:M5 ***************** @ newsread2.news.pas.earthl ink.net:
"J. Christopher Miller" <th*******@earthlink.net> wrote in
news:M5*****************@newsread2.news.pas.earthl ink.net:


使用< a href =" /foldername/otherpage.html">之间的区别是什么? (双引号)和< a href =''/ foldername / otherpage.html''>(单引号)?
Hi,

What''s the difference between using <a href="/foldername/otherpage.html"> (double quotes) and <a href=''/foldername/otherpage.html''>(single quotes)?

无论如何。您可以在属性

None whatsoever. You can use either type of quote around attribute


值周围使用任一类型的引用(只要开始和结束引用都是相同的类型)。
这样,如果由于某种原因,属性值必须包含一种类型的引用
字符,您可以使用另一种类型来包围它

values (as long as both the opening and closing quote are the same type). That''s so that if, for some reason, the attribute value has to contain a quote
character of one type, you can use the other type to surround it



...虽然这是为了方便,但你也可以



... though that''s for sheer convenience, since you can also just



替换实体引用(& quot;)或字符代码。


substitute an entity reference (&quot;) or a character code.




有时你需要在属性值中引用,例如,如果你在事件处理程序中使用参数调用

javascript函数。当然你

也可以用反斜杠逃脱它们,所以你仍然是对的,这是一个方便的问题。


-

Markus



Sometimes you need quotes inside attribute values, for example if you call a
javascript function with an argument in an event handler. Of course you
could also escape them with a backslash, so you are still right and it is an
issue of convenience.

--
Markus


这篇关于链接到其他网页的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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