今天遇到IE不显示样式表的情况,百思而不得其解,firefox 就可以。
/*链接样式*/
a {text-decoration:none;}
a:link {color: #0063dc;}
a:visited,a:active {color: #0063dc;}
a:hover {color:#fff;background: #0063dc;}
在一大堆代码中间找到这句,只要加了/*链接样式*/,IE就出问题!其它中文就没问题!本页书写就没有,如果
外部引用就挂!
guoshuang20051121+应该是因为utf-8的页面,其.css也必须是utf-8否则…
更多显示方法在Syndicating the Firefox download counter
首先页面需要通过xhtml验证,否则feed验证无从谈起。
RSS2.0似乎严格一些。下面同样内容在ATOM1.0验证中并不警告。
description should not contain onclick tag
description不能包含 script meta embed object 等元素,不安全。
description should not contain relative URL references
description不能包含相对URL,别人用feed reader看不到图片或者打不开这些链接。
rss2 加入css样式
http://blog.guoshuang.com/david/rss2.asp
http://blog.guoshuang.com/atom.asp
? feed 指定名字空间 xlt 就取不到! xmlns=”…”
以前总认为网页验证更多是虚荣的成分,但做一遍下来,感觉还是很有必要,不严谨甚至错误的地方比比皆是。下面是验证地址
(BTW 本页验证就不过,昨天都好了,可是下午的一个改动又改回到一个旧版本,这次改动很乱,老是换电脑换地方,很多代码都是重复改了两遍以上,)
http://validator.w3.org/check?uri=完整地址
http://www.htmlhelp.com/cgi-bin/validate.cgi?url=完整地址
二者大同小异,常见错误如下:
文档DOCtype类型没有定义或者不正确
个人感觉既然验证就 xhtml 1.0 好了,web设计绝大部分内容都能解决,就是嵌入多媒体麻烦了点。注意 DOCtype 声明中引号部分的大小写不能改变。
“-//W3C//DTD XHTML 1.0 Strict//EN” “http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd”>
大小写混用
如果没什么问题的话,请不要使用大写,而且绝对不能混用(命名用小写,调用却用大写?)
页面编码问题
it contained one or more bytes that I cannot interpret as gb2312
现在是UTF-8的世界,gb2312在很多时候都会被警告。gb2312的页面甚至不能包含繁体中文,虽然可以显示,但验证会报告错误。另外,feed 验证时,gb2312也会被 Warning。
不完整标签
unclosed start-tag requires SHORTTAG YES.
xhtml 所有元素都必须结束。单标签也需要斜线结束,如
html head title body 包括结束都不能少!
属性值没有加引号
an attribute value specification must be an attribute value literal
比如
需要写成
使用了不存在的属性
there is no attribute “target”.
比如xhtml中链接a没有 target属性,form没有name属性,img 没有 align属性等等。
换成
最后用javascript遍历一遍替换为 target即可。(参看本页源代码最后面的 changelinkstyle.js)
form不加name,用 document.forms[0]或者id或者this.form来操作。
换成
换成
当然,你可以写到样式表中而不用inline书写。
javascript书写问题
下面结构”一个都不能少!”
另外,类似 document.write(”
“) 这样的代码最好加上反斜线
document.write(”
“)
地址串中&(Ampersands)问题
书写URL时必须把 & 转换成 & 普通内容可以直接书写。类似问题还有 > < 如果不是html代码(是网页内容)的话,请改成
>
<
greater than 大于
less than 小于
使用了不存在的标签
element “font” undefined.
比如 font就不再存在。embed 等
块元素(block)被行内元素(inline)包裹
body的根元素都必须是 h1-7,p,div 等块元素。另外,行内元素包含块元素也会报错。
图片必须有 alt(alternate)替换文字或者 longdesc(long description)长文字说明
实在没有就 alt=”" 但不能不写。
就想起来这么多了,大家有什么错误也可以报过来,一起分析分析。
完整错误信息说明在:
http://validator.w3.org/docs/errors.html
Feed 验证问题
这是feed验证地址。
http://feedvalidator.org/check.cgi?url=完整feed地址
非UTF-8和ISO的编码都会受到警告!atom现在是1.0,0.3已经推荐不使用(Deprecated )了。RDF(rss1)已经两年都不更新了,估计以后就挂了。常见错误主要是格式问题,主要是日期格式不同。Atom多了个 lastUpdated,这个blog根本就没有进库,需要处理。
http://www.atomenabled.org/developers/syndication/atom-format-spec.php
http://feedvalidator.org/docs/rss2.html
必须写在第一行!!!
更多资料:
生成更多验证的链接
大量验证,参考链接
508验证的检查条目
(a) A text equivalent for every non-text element shall be provided (e.g., via “alt”, “longdesc”, or in element content).
非文字项目必须有文字说明(如 alt,longdesc等)
(b) Equivalent alternatives for any multimedia presentation shall be synchronized with the presentation.
多媒体也必须有文字说明
(c) Web pages shall be designed so that all information conveyed with color is also available without color, for example from context or markup.
没有颜色的时候,页面也是可读的
(d) Documents shall be organized so they are readable without requiring an associated style sheet.
没有样式表的页面也是可读的。(可以试一下用firefox或者opera的author mode来看看你的页面在没有样式表的情况下是什么德行。。。)
(e) Redundant text links shall be provided for each active region of a server-side image map.
图片热点链接的map要有说明文字。
(f) Client-side image maps shall be provided instead of server-side image maps except where the regions cannot be defined with an available geometric shape.
(g) Row and column headers shall be identified for data tables.
(h) Markup shall be used to associate data cells and header cells for data tables that have two or more logical levels of row or column headers.
(i) Frames shall be titled with text that facilitates frame identification and navigation.
(j) Pages shall be designed to avoid causing the screen to flicker with a frequency greater than 2 Hz and lower than 55 Hz.
(k) A text-only page, with equivalent information or functionality, shall be provided to make a web site comply with the provisions of this part, when compliance cannot be accomplished in any other way. The content of the text-only page shall be updated whenever the primary page changes.
(l) When pages utilize scripting languages to display content, or to create interface elements, the information provided by the script shall be identified with functional text that can be read by assistive technology.
(m) When a web page requires that an applet, plug-in or other application be present on the client system to interpret page content, the page must provide a link to a plug-in or applet that complies with §1194.21(a) through (l).
(n) When electronic forms are designed to be completed on-line, the form shall allow people using assistive technology to access the information, field elements, and functionality required for completion and submission of the form, including all directions and cues.
(o) A method shall be provided that permits users to skip repetitive navigation links.
(p) When a timed response is required, the user shall be alerted and given sufficient time to indicate more time is required.
或者换个说法
Check read order of content by removing style sheets and tables, linearizing the page or by using a text-only browser like Lynx
Enlarge the text and resize the window
Check for color by looking at content in grey scale
Check images for valid and relevant text descriptors
Check if all activities on the page can be done from the keyboard. Example, form elements, navigation links and other interactive elements are not dependent on the mouse
Check to see if links make sense out of context
Check if form elements are associated with the label using
Check all video and audio content for captions or text descriptors