开发者

w3c markup validator ampersand (&) error

Is there any workaround for the w3c validation开发者_如何学Python error for an & present in urls or some other place in HTML markup?

It says:

& did not start a character reference. (& probably should have been escaped as &.)

The ampersand in my case is a part of a url for gravatar thumbnail. This is the problematic part of a url:

c91588793296e2?s=50&d=http%3A%2F%.


for each & sign you got write & in your example it would be:

c91588793296e2?s=50&d=http%3A%2F%


Use & for literal ampersands, even in URLs.

http://htmlhelp.com/tools/validator/problems.html#amp


Replace with &


should be:

c91588793296e2?s=50&d=http%3A%2F%.

notice the &

I know it feels wonky, but ampersands have to be encoded as html entities, which are confusingly denoted with ampersands.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜