转向4.01严格:隐藏字段等问题。 [英] Moving to 4.01 strict: problem with hidden fields et al.

查看:66
本文介绍了转向4.01严格:隐藏字段等问题。的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

亲爱的所有


按照经常重复的建议和ciwas我已经使我的网站

接近4.01严格(正在努力)。有一些项目,我会赞赏你的建议:


1.隐藏的字段
http://www.zoo.co.uk/~mmenterprises/contact.htm
我正在使用马特脚本档案中的FormMail。 W3C验证器

反对隐藏的字段,除非我把P放在它们周围。那给了我不想要的空行

。所以我把一个DIV围绕它们并将它们设计为

显示:无,但这似乎太像一个kludge!什么是处理隐藏表格字段的清洁工具?


2.图像不流动
http://www.zoo.co.uk/~mmenterprises/kgs/index.html

我有一个接一个的小图像,没有间隙。我是

旨在进行流畅的设计,我希望它们能够包裹起来。相反,他们

形成了一条巨大的长水平线。所以我在每个图像之间放了一个空格

然后它们表现得如预期的那样。但是我想使用border

属性而不是空格。有没有办法让它们没有

插入空间?


3.免费柜台

任何页面(例如以上引用)

来自免费网络摄像头的HTML片段无法验证。我可以修复

边框和目标属性,但你有什么建议可以用于

language =" JavaScript"?除了完全删除javascript?


4.还有其他意见或建议吗?

除了摆脱表格布局和改进我的alt标签。什么

其他应该不错?


非常感谢


马克。
< br $>
-

M& M Enterprises Http://www.mmenterprises.co.uk/

你不能改变过去,但你可以塑造未来

Dear all

Following the oft-repeated advice here and ciwas I have made my site
nearly 4.01 strict (working on it). There are some items on which I would
appreciate your advice:

1. Hidden fields
http://www.zoo.co.uk/~mmenterprises/contact.htm
I am using FormMail from Matt''s Script Archive. The W3C validator
objected to the hidden fields unless I put, say, P round them. That gave
me unwanted blank lines. So I put a DIV round them and styled them as
display: none but that seems too much like a kludge! What is the cleaner
way to handle hidden form fields?

2. Images do not flow
http://www.zoo.co.uk/~mmenterprises/kgs/index.html
I had a whole lot of small images one after the other with no gaps. I was
aiming for a fluid design and I expected them to wrap. Instead they
formed one huge long horizontal line. So I put a space between each image
then they behaved as expected. However I would like to use border
properties instead of spaces. Is there a way to make them wrap without
inserting the space?

3. Free counter
Any page (e.g. the above cited)
The HTML fragment from the free webcounter does not validate. I can fix
the border and target attributes but what suggestions do you have for for
language="JavaScript"? Apart from remove the javascript completely?

4. Any other comments or suggestion?
Apart from get rid of tables for layout and improve my alt tags. What
else should would be good to do?

Many thanks

Mark.

--
M&M Enterprises Http://www.mmenterprises.co.uk/
"You cannot change the past but you can shape the future"

推荐答案

Mark McLellan< ma *********** @ mmenterprises.co.uk>写道:
Mark McLellan <ma***********@mmenterprises.co.uk> wrote:
按照经常重复的建议和ciwas我已经使我的网站严格接近4.01(正在努力)。


实际上有两所学校。我的学校说,在可行的情况下,编写逻辑标记以及将视觉和/或
外观分开的结构和内容是非常重要的。这通常意味着使用Strict,但是

这不是目标,只是副作用。

1.隐藏的字段
http://www.zoo.co.uk/~mmenterprises/contact.htm
我正在使用马特的脚本档案中的FormMail。


Gasp。你的意思是原始的不可靠版本是一个严重的安全

威胁?但这是一个不同的问题。

W3C验证器
反对隐藏的字段,除非我把P放在它们周围。


的确如此。严格的部分是要求所有内联

元素内部块级容器。如果你问我,有点傻,虽然它只是一个有用的原则。但是关于

来形成字段就没有什么意义了。

这给了我不必要的空白行。


您可以使用CSS建议不同的渲染。但是你为什么要使用P?
?对于

这个词来说,它真的不是一个段落。

所以我把DIV围绕它们并将它们设计成
作为显示:none


这是不需要的,因为隐藏的字段无论如何都不显示(默认情况下是

) - 如果浏览器想要显示它们一些奇怪的原因,

我们最好不要干涉)。

但这似乎太像了一个kludge!


所以显示:不需要任何部分。除非你认为阻止,否则DIV标记并不是一个好的方法,而不是b $ b。严格限制kludge的原则。

如果你没有合理的选择而且你需要(或想要)将某个块作为一个块,DIV是唯一明智的选择。从某种意义上来说,它甚至可以合乎逻辑,将隐藏的字段组合在一起。


现在,我看看你的标记,你似乎已经制作了每个隐藏字段a

段,这可能意味着渲染中有一些间距,因此你将
用dra:none包裹在DIV中。但这不是必需的:

你可以简单地使用< div>< input ...>< input ...> ...< input ...> ;< / div>。

2.图像不流动
http://www.zoo.co.uk/~mmenterprises/kgs/index.html
我有一大堆小图片另一个没有差距。我的目标是流畅的设计,我希望它们能够包装。相反,他们形成了一条巨大的长水平线。


这有点令人惊讶,因为即使你们之间没有

空格(< img ...>< img ...>)。但是,如果图像在表格单元格内,似乎不会发生



所以这与Strict vs. Transitional没有直接关系,除了在

意义上说,如果你应用了严格的精神,你就不会使用表格

进行布局,你就可以避免这个问题。 :-)(严格不允许

布局表当然,但Strict的想法部分是

委托演示文稿到样式表。)说真的,我我认为在这里使用一个

表并不是很严重,用CSS替换它将是一个主要的b



看来如果你设置

td img {float:left;样式表中的$ b / b,演示文稿就变成你想要的 - 虽然你需要

来照顾一串图像后停止浮动,例如

with< br style =" clear:both"> (这是名义上严格的说法

< br clear =" all">)。

3.免费专柜


计数器被认为有害。

来自免费网络摄像机的HTML片段无法验证。


TANSTAAFL。 :-)

我可以修复
边框和目标属性但你有什么建议
for language =" JavaScript"?除了完全删除javascript?


您可以删除语言属性,如果您希望

符合严格规则,则需要删除。删除它没有任何效果,因为

支持脚本的浏览器无论如何都使用JavaScript作为默认脚本语言。

语言的唯一需要=" ..."属性是在极少数情况下

,你希望区分不同版本的JavaScript。

4.还有其他意见或建议吗?
除了摆脱用于布局的表格和改进我的alt标签。什么
其他应该是好事?
Following the oft-repeated advice here and ciwas I have made my site
nearly 4.01 strict (working on it).
Actually there are two schools on this. My school says that it''s important
to write logical markup and separate structure and content from visual
appearance, as far as feasible. This normally means using Strict, but
that''s not the goal, just a side effect.
1. Hidden fields
http://www.zoo.co.uk/~mmenterprises/contact.htm
I am using FormMail from Matt''s Script Archive.
Gasp. You mean the original unreliable version that is a serious security
threat? But that''s a different issue.
The W3C validator
objected to the hidden fields unless I put, say, P round them.
Indeed. Part of being Strict is the requirement of putting all "inline
elements" inside block level containers. A bit silly if you ask me, though
it''s _mostly_ a useful principle. But there''s little point in it as regards
to form fields for example.
That gave me unwanted blank lines.
You could suggest a different rendering by using CSS. But why did you
use P? It''s really not a paragraph in any sensible interpretation of the
word.
So I put a DIV round them and styled them
as display: none
That''s not needed since hidden fields aren''t displayed anyway (by default
that is - and if a browser wanted to display them for some strange reason,
we had better not interfere).
but that seems too much like a kludge!
So the display: none part is not needed. The DIV markup isn''t a kludge,
unless you regard the "blocking" principle of Strict itself a kludge.
When you have no logical alternative and you need (or want) to make
something a block, DIV is the only sensible alternative. And it could even
be logical in a sense, for grouping hidden fields together.

Now that I look at your markup, you seem to have made each hidden field a
paragraph, which may imply some spacing in rendering, and therefore you
have wrapped them inside a DIV with display: none. But that''s not needed:
you can simply use <div><input ...><input ...>...<input ...></div>.
2. Images do not flow
http://www.zoo.co.uk/~mmenterprises/kgs/index.html
I had a whole lot of small images one after the other with no gaps. I
was aiming for a fluid design and I expected them to wrap. Instead they
formed one huge long horizontal line.
That''s a bit surprising, since images normally wrap even when you have no
spaces between them (<img ...><img ...>). But it seems that this does not
happen if the images are inside a table cell!

So this is not directly related to Strict vs. Transitional, except in the
sense that if you applied the "spirit of Strict", you wouldn''t use a table
for layout and you would avoid the problem. :-) (Strict does not disallow
layout tables of course, but the idea of Strict is, in part, to
delegate presentation to style sheets.) Seriously, I think the use of a
table is not very serious here, and replacing it by CSS would be a major
effort.

It seems that if you set
td img { float: left; }
in a style sheet, the presentation becomes what you want - though you need
to take care of stopping the floating after a string of images, e.g.
with <br style="clear:both"> (that''s the nominally Strict way of saying
<br clear="all">).
3. Free counter
Counters considered harmful.
The HTML fragment from the free webcounter does not validate.
TANSTAAFL. :-)
I can fix
the border and target attributes but what suggestions do you have for
for language="JavaScript"? Apart from remove the javascript completely?
You can remove the language attribute, and need to do so if you wish to
comply with Strict rules. Removing it has no effect, since browsers that
support scripting use JavaScript as the default scripting language anyway.
The only need for the language="..." attribute is in the rare situations
where you wish to distinguish between different versions of JavaScript.
4. Any other comments or suggestion?
Apart from get rid of tables for layout and improve my alt tags. What
else should would be good to do?




正如我所写,我不认为布局表是一个大问题。我不认为
认为照片的alt属性可以基本上更好

(虽然这取决于b1,b2等代码是否有一些

对于没有看到图像的人的信息价值 - 我无法猜测

代码是什么)。对于柜台,没有好的替代文字,但

自1996年3月17日以来快速访问的人

相当奇怪; alt =" some number of会更有意义。


-

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

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



As I wrote, I wouldn''t regard layout tables as a big problem here. I don''t
think the alt attributes for the photos can be made essentially better
(though this depends on whether codes like b1, b2, ... have some
informative value to a person who does not see the images - I cannot guess
what the codes are). For the counter, there''s no good alt text, but
"Visited by fastcounter people since 17 March 1996"
is fairly odd; alt="some number of" would make more sense.

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


Mark McLellan写道:
Mark McLellan wrote:
亲爱的所有

经常重复建议在这里和ciwas我已经使我的网站严格4.01(工作)。有些项目我会赞赏你的建议:

1.隐藏的字段
http://www.zoo.co.uk/~mmenterprises/contact.htm
我正在使用Matt的FormMail的脚本档案。 W3C验证器
反对隐藏的字段,除非我把P放在它们周围。这给了我不需要的空白行。所以我把一个DIV围绕它们并将它们设计为
显示:无,但这似乎太像一个kludge!处理隐藏表单字段的清洁方法是什么?


#1不要使用马特的剧本。它是不安全的,允许垃圾邮件发送者从您使用的服务器上反弹
邮件。


#2阅读有关您看到的错误的规范。你会发现< input>

是一个必须包含在块级元素中的内联元素。

表单元素的推荐元素是< fieldset>但是< div>或

< p> (< input>不是段落)会起作用。我有时使用

fieldset并将其设置为不显示默认边框。

2.图像不流动
http://www.zoo.co.uk/~mmenterprises/kgs/index.html
我有一个接一个的小图像,没有间隙。我的目标是流畅的设计,我希望它们能够包裹起来。相反,他们形成了一条巨大的长水平线。所以我在每个图像之间放置一个空格
然后它们表现得如预期的那样。但是我想使用border
属性而不是空格。有没有办法让它们包裹而不插入空间?


我不确定你指的是什么图像。将它们放置在100%宽的

3.免费计数器
任何页面(例如上面引用的)
HTML来自免费网络摄像头的片段无法验证。我可以修复
边框和目标属性,但对于
language =" JavaScript"?除了完全删除javascript?


语言已被弃用。您已经在使用正确的属性,

类型;这就是所有需要的。

4.任何其他意见或建议吗?
除了摆脱表格布局和改善我的alt标签。什么
其他应该是好事?

非常感谢

马克。
Dear all

Following the oft-repeated advice here and ciwas I have made my site
nearly 4.01 strict (working on it). There are some items on which I would
appreciate your advice:

1. Hidden fields
http://www.zoo.co.uk/~mmenterprises/contact.htm
I am using FormMail from Matt''s Script Archive. The W3C validator
objected to the hidden fields unless I put, say, P round them. That gave
me unwanted blank lines. So I put a DIV round them and styled them as
display: none but that seems too much like a kludge! What is the cleaner
way to handle hidden form fields?
#1 Don''t use Matt''s script. It''s insecure allowing spammers to bounce
mail off of the server you use.

#2 Read the specs about the errors you see. You will find that <input>
is an inline element that must be enclosed within a block level element.
The recommended element for form elements is <fieldset> but <div> or
<p> (<input> is not a paragraph though) will work. I sometimes use
fieldset and set it to not display the default border.

2. Images do not flow
http://www.zoo.co.uk/~mmenterprises/kgs/index.html
I had a whole lot of small images one after the other with no gaps. I was
aiming for a fluid design and I expected them to wrap. Instead they
formed one huge long horizontal line. So I put a space between each image
then they behaved as expected. However I would like to use border
properties instead of spaces. Is there a way to make them wrap without
inserting the space?
I''m not sure what images you are referring to. Place them in 100% wide
<div>s?

3. Free counter
Any page (e.g. the above cited)
The HTML fragment from the free webcounter does not validate. I can fix
the border and target attributes but what suggestions do you have for for
language="JavaScript"? Apart from remove the javascript completely?
language is deprecated. You are already using the correct attribute,
type; that''s all that''s needed.

4. Any other comments or suggestion?
Apart from get rid of tables for layout and improve my alt tags. What
else should would be good to do?

Many thanks

Mark.




Do一些谷歌搜索列表链接CSS。你可以摆脱那些丑陋的b $ b在菜单中的链接之间。听起来你已经确定了其他一些正确的改进/变化(表格,alt属性)。


另一个建议。看起来你可能已经在做了。阅读

阅读;建议,这个新闻组,alt.html,ciwas

(样式表),书籍,教程,等等。


-

Stan McCannUncle Pirate http://stanmccann.us/pirate.html

网站管理员/计算机中心经理,NMSU在Alamogordo

Cooordinator,Tularosa Basin Chapter,ABATE of NM; AMA#758681; COBB

''94 1500 Vulcan(现已失事):( http: //motorcyclefun.org/Dcp_2068c.jpg

生活的热情必须包括死亡的意愿。 - RA Heinlein



Do some google searching on "list links css." You can get rid of those
ugly | between links in your menu. It sounds like you''ve already
decided on some other correct improvements/changes (table,alt attributes).

One other suggestion. It looks like you may be doing already. Read
read read; the recommendations, this newsgroup, alt.html, ciwas
(stylesheets), books, tutorials, whatever.

--
Stan McCann "Uncle Pirate" http://stanmccann.us/pirate.html
Webmaster/Computer Center Manager, NMSU at Alamogordo
Cooordinator, Tularosa Basin Chapter, ABATE of NM; AMA#758681; COBB
''94 1500 Vulcan (now wrecked) :( http://motorcyclefun.org/Dcp_2068c.jpg
A zest for living must include a willingness to die. - R.A. Heinlein


Uncle Pirate< st ** @ surecann.com>写道:
Uncle Pirate <st**@surecann.com> wrote:
表单元素的推荐元素是< fieldset>但是< div>或
< p> ;(< input>不是段落)会起作用。
The recommended element for form elements is <fieldset> but <div> or
<p> (<input> is not a paragraph though) will work.




我没有注意到在

W3C材料的一般情况。但是很明显情况下,逻辑上最合适的是
,比如对一组单选按钮进行分组。

这将是奇怪的是使用它,例如,如果你只有一个隐藏的字段。


此外,< legend>元素在< fieldset>中是强制性的,使它成为

而不是适合隐藏的领域。 (你可以在那里使用空内容,

< legend>< / legend>,但标记可能仍会影响渲染。)


-

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

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



I haven''t noticed any specific recommendation on using <fieldset> in
general in W3C material. However there are clearly situations where it is
most adequate logically, like for grouping a set of radio buttons.
It would be odd to use it e.g. if you have just one hidden field.

Moreover, the <legend> element is obligatory in <fieldset>, making it
rather unsuitable for hidden fields. (You can use empty content there,
<legend></legend>, but the markup might still affect rendering.)

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


这篇关于转向4.01严格:隐藏字段等问题。的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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