在哪里写我应该使用CSS定位? [英] Where Is It Written That I Should Use CSS Positioning?

查看:64
本文介绍了在哪里写我应该使用CSS定位?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

这个论点最近出现了两三次。


我们公司有一个网络标准文件说使用有效

HTML 4;我们不建议切换到基于DIV的CSS-P布局

但是,表格要容易得多。


那个'因为我们有很多开发人员还没有准备好转到

CSS-P和DIV。


但是我''我被告知我们的政策是矛盾的。如果我们要使用标准,那么我们应该使用CSS定位而不是TABLE代码。


但我们_are_使用标准!我们正在使用带有DOCTYPE

和所有内容的有效HTML。我们不使用FONT标签(虽然即使_that_仍然是在过渡HTML中有效的b $ b,你注意到了吗?)和所有的格式,

所有的背景和颜色,图像和字体都是风格

表格,不在页面中。


究竟是什么,才是真正的区别


-------- ------------------------ --------

| TD | | TD | | TD |

| | | | | |

| | | | | |

| | | | | |

| | | | | |

| | | | | |

| | | | | |

| | | | | |

| | | | | |

| | | | | |

-------- ------------------------ --------





-------- ------------------ ------ --------

| DIV | | DIV | | DIV |

| | | | | |

| | | | | |

| | | | | |

| | | | | |

| | | | | |

| | | | | |

| | | | | |

| | | | | |

| | | | | |

-------- ------------------------ --------


无论如何?内容在页面中的顺序相同,如果我

包含跳到内容,将人们带到中心TD的链接,

谁让我受伤了?


表格只能用于表格内容,我听说你说 -

嗯,在某种程度上,这不是传统的布局表格吗?一列导航,

一列内容,右边一列。他们在

三个不同的类别。桌子真的只用于从1993年到东柏林的白菜消费量的统计数据吗?

1994年?


我忘记了原来的问题 - 哦,是的,它在哪里写的,

实际上字面上是在W3网站或规范中写的

我必须使用CSS- P现在还是我的代码没有使用标准?


因为与我争论的女人最终只是说好吧,

你反对它的精神我说我没有一个

精神验证器,只是一个HTML验证器。


开玩笑说,我的对手有哪些文件_should_我指的是 -

其中你应该使用CSS-P写了,谁下令 - 或者它是什么?b $ b b只是现代网络开发者的文化假设,sibboleth?

解决方案

Jack Hughes写道:

这个论点最近出现了两三次。


实际上,在ciwah,它的出现远远超过两三次b
次。很遗憾你没看过这些主题。

我们公司有一个网络标准文件说使用有效的
HTML 4;


这太令人惊讶了。大多数公司都没有意识到有关

良好创作实践的任何内容。我可以问一下这是哪家公司吗?

我们不建议切换到基于DIV的CSS-P进行布局,但是表格要容易得多。


我不认为桌子更容易,但css定位不适用于内心深处的b / b
。即使没有错误,它也会很难,并且那里有很多错误,很多都是错误的。

但我被告知我们的政策是矛盾的。如果我们要使用标准,那么我们应该使用CSS定位而不是TABLE
代码。


截至2004年,CSS是用于呈现网络文档的合适工具。

HTML从未用作桌面出版语言。特别是通过HTML 3.2,努力将其打成一片,失败了,为我们留下了遗留文件的过渡性HTML格式。和CSS一个更明智的

方法。

但我们_are_使用标准!我们正在使用带有DOCTYPE的有效HTML和一切。


有人感到困惑。无论是你,还是告诉过你的人。

HTML文档当且仅当它符合

特定doc类型定义的语法时才有效。由于表格是几个HTML

版本的一部分,任何因任何原因使用表格的文档都将被验证。

究竟是什么,才是真正的区别

-------- ------------------------ --------
| TD | | TD | | TD |
-------- ------------------------ --------


这个标记声称一行中有表格数据,并且每个位

的数据都以某种方式与其他位相关。因此,

用户代理必须以这样的方式呈现数据,即数据有意义。在您提供的ascii艺术示例中,ua已经选择了一个表格的逻辑表示形式,并且列表并排显示

,正如人们可能会发现的那样一本书。



-------- ---------------------- - --------
| DIV | | DIV | | DIV |
-------- ------------------------ --------


div元素应包含一些内容划分;除此之外,

div元素在语义上毫无意义。因此,div

元素的内容不一定与另一个元素的内容相关,甚至是

,其中这些div元素通过CSS并排呈现,如在

你的第二个ascii艺术例子。

内容在页面中的顺序相同,


表格内容线性化的布局。是不是错误的方式来做b
做事情。不滥用表格布局是正确的做事方式。

如果我包含跳到内容将人们带到中心TD的链接,谁让我受伤了?


您混淆了几个不同的问题。 A跳到内容链接是

与表格布局无关,也与验证无关。

表格只能用于表格内容,我听说你说 -


这是否意味着你*读*其他线程?如果是这样的话,你为什么觉得需要再开始另一个回合?

好​​吧,在某种程度上,这不是传统的布局表格吗?一栏
导航,一列内容,一列右边的任何内容。


谁说布局是传统的?是什么让布局变得传统?

也许你的意思是它现在很受欢迎?这可能是真的,但它也可能会发生变化。


无论如何,它不仅仅是因为它与一些

位于其他位旁边。一篇杂志文章可能有一个带有

短篇相关文章的侧边栏。侧边栏的展示不是

表。它是相关文章在主文章旁边的一列

中显示的布局。人们也可以选择在页面底部或下一页上提供简短的,与b $ b相关的文章。这个

不影响读者理解。


相比之下,必须以某种方式呈现一张表格,允许

读者要弄清楚数据。无法从

表中删除一列,将其移至下一页,并希望读者理解它。

表是否真的只用于统计关于1993年至1994年东柏林白菜的消费情况?


当然不是。他们还将用于在伦敦展示Lee

Perry cds的销售;墨西哥城的污染水平;在印度,法国和美国制作的电影价格为b $ b;等等。

在哪里写的,实际上字面意思是在W3网站
或规范中写的我现在必须使用CSS-P或我的代码
isn''使用标准?


当然,在HTML 4推荐中。

http://www.w3.org/TR/html4/struct/tables.html


请参阅第一部分,表格介绍。

我与之争辩的女人最终只是说嗯,你是否反对它的精神。


滥用表格是违反HTML的......

我说我没有精神验证器,只是一个HTML
Validator"。




....但是这种滥用表格并没有违反

语言的语法。我读过的关于这个主题的最好的文章来自J. Korpela:

http://www.cs.tut.fi/~jkorpela/html/validation.html

B. Pearson将在不久之后,我会尽量让你对所谓的html历史感到困惑。


祝你好运。

-

Brian(删除.invalid给我发电子邮件)
http://www.tsmchughs.com/


" Jack Hughes" < JA ******** @ yahoo.com> schrieb im Newsbeitrag

新闻:f4 ************************* @ posting.google.co m ... < blockquote class =post_quotes>这个论点最近出现了两三次。

[...]
我忘记了原来的问题 - 哦是的,它在哪里写的,
实际上字面上在W3网站或规范中写的是我现在必须使用CSS-P或我的代码没有使用标准吗?



?h - 如果你知道这些论点,你为什么要再问一次?您可以自由使用

您感觉舒适的编码技术。你不需要你的ciwah / ciwas常客的确定

,对吗?


这不是关于必须的对于宗教来说,只需要知道开发它们的人应该如何做事,并且它很有必要知道好的论据。反对做这个或者这样的方式。它只是让你自由决定你走哪条路还有它

让你有能力与你的老板,客户和

同事讨论这个问题。所以了解这些问题会让你变得专业。但是它没有必要你同意这里所写的所有内容,也不是必须让其他人同意你的观点。


-

Markus


ja ******** @ yahoo.com (杰克·休斯)在留言中写道:< f4 ***************** ********@posting.google.c om> ...

其中你应该使用CSS-P写的




ciwah


由一群只为一个人带来大脑的针头,所以

当他们跳到它上面时,他们不能接受任何其他价值的任何价值。


了解什么你在做。然后做出适当的选择。


无处不在的毯子应用程序可能比

稍微好一点,同样一致地使用1x1.gif,但两者都不如正如环境要求那样做正确的事情。


CSS中的三列布局很糟糕,因为浮动是可疑的,所以是

宽度或边距:自动。去三列表,因为它是好的,它很简单,它很有效。 OTOH,5柱表因为你不知道边距或填充是不是很好。


如果您正在为移动设备创作,你会开始真的好吗

看到倾销臃肿的好处。



我们有时会忘记读者是如何搞砸的ciwah是 -

即使是白痴。你会因为最琐碎的

错误而受到抨击,但是在企业网站的大世界里建立了这个级别

的技术专长和实践仍然是可怜的。在我提供内容表格< corporate#1>的那一刻,我有一个

的问题。

< corporate#2>并且他们正在偷偷地剥去&符号实体和

各种内容,然后想知道为什么我抱怨它不是

更长的有效HTML - 但是它在我的浏览器中看起来不错他们发牢骚。


This argument has come up two or three times lately.

We have a web standards document at our company that say "Use valid
HTML 4; We don''t recommend switching to DIV-based CSS-P for layout
just yet though, tables are a lot easier."

That''s because we have a lot of developers who aren''t ready to move to
CSS-P and DIVs just yet.

But I''m being told our policies were contradictory. If we''re going to
use standards, then we should use CSS positioning not TABLE code.

But we _are_ using standards! We''re using valid HTML with a DOCTYPE
and everything. We don''t use the FONT tag (though even _that_ is still
valid in Transitional HTML, did you notice?) and all the formatting,
all the backgrounds and colors and images and fonts are in the style
sheet, not in the page.

What, after all, is the real difference between

-------- ------------------------ --------
| TD | | TD | | TD |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
-------- ------------------------ --------

and

-------- ------------------------ --------
| DIV | | DIV | | DIV |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
-------- ------------------------ --------

anyway? The content comes in the same order in the page, and if I
include a "skip to content" link that takes people to the centre TD,
who have I hurt?

Tables should only be used for Tabular content, I hear you say --
well, isn''t the traditional layout tabular, in a way? A column of nav,
a column of content, a column of whatever on the right. They''re in
three different categories. Are tables really only to be used for
statistics on the consumption of cabbage in East Berlin from 1993 to
1994?

I forgot my original question -- oh yeah, where is it written,
actually literally where in the W3 website or the spec is it written
that I must use CSS-P now or my code isn''t using standards?

Because the woman who I was arguing with eventually just said "well,
you''re going against the SPIRIT of it" and I said "I don''t have a
Spirit Validator, just an HTML Validator".

Joking aside, what document _should_ my opponent have pointed me to -
where is "Thou Shalt Use CSS-P" written, who decreed it - or is it
just a cultural assumption made by modern web developers, a sibboleth?

解决方案

Jack Hughes wrote:

This argument has come up two or three times lately.
Actually, in ciwah, it has come up far more than just two or three
times. Shame you didn''t read those threads.
We have a web standards document at our company that say "Use valid
HTML 4;
That''s suprising. Most companies are unaware of anything relating to
good authoring practices. May I ask which company this is?
We don''t recommend switching to DIV-based CSS-P for layout just yet
though, tables are a lot easier."
I don''t think tables are easier, but css positioning is not for the
faint of heart. Even if there were no bugs, it''d be hard, and there
are bugs, lots of them.
But I''m being told our policies were contradictory. If we''re going
to use standards, then we should use CSS positioning not TABLE
code.
As of 2004, CSS is the proper tool for presentation of web documents.
HTML was never intended as a desktop publishing language. Efforts to
hammer it into one, especially via HTML 3.2, failed, leaving us with
transitional HTML for "legacy documents" and CSS for a more sensible
approach.
But we _are_ using standards! We''re using valid HTML with a DOCTYPE
and everything.
Someone is confused. It''s either you, or whoever told you this. An
HTML document is valid if and only if it conforms to the syntax of a
particular doc type definition. Since tables are part of several HTML
versions, any document which uses tables for any reason will validate.
What, after all, is the real difference between

-------- ------------------------ --------
| TD | | TD | | TD |
-------- ------------------------ --------
This markup claims there is tabular data in one row, and that each bit
of data is related to the other bits in some way. Therefore,
user-agents must present the data in such a way that the data makes
sense. In the ascii art example you provided, the ua has chosen a
logical presentation of a table, with the columns presented
side-by-side, as one might find in a book.
and

-------- ------------------------ --------
| DIV | | DIV | | DIV |
-------- ------------------------ --------
A div element should contain some division of content; beyond that,
div elements are semantically meaningless. Thus, the contents of a div
element are not necessarily related to the contents of another, even
where such div elements are presented, via CSS, side-by-side, as in
your second ascii art example.
The content comes in the same order in the page,
A table layout where the content "linearizes" is the less wrong way to
do things. Not abusing tables for layout is the right way to do things.
if I include a "skip to content" link that takes people to the
centre TD, who have I hurt?
Your mixing up several different issues. A "skip to content" link is
not related to table layouts, nor to validation.
Tables should only be used for Tabular content, I hear you say --
Does this mean you *did* read those other threads? If so, why did you
feel the need to start yet another go-round?
well, isn''t the traditional layout tabular, in a way? A column of
nav, a column of content, a column of whatever on the right.
Who says that layout is traditional? What makes a layout traditional?
Perhaps you mean it is popular at the moment? That may be true, but it
is also subject to change.

In any case, it is not a table merely because it is laid out with some
bits next to other bits. A magazine article may have a sidebar with a
short, related article. The presentation of the sidebard is not a
table. It is layout where the related article is presented in a column
next to the main article. One might also choose to present the short,
related article at the bottom of the page, or on the next page. This
does not affect reader comprehension.

A table, by contrast, must be presented in some way that allows the
reader to make sense of the data. One cannot remove one column from a
table, move it to the next page, and expect readers to make sense of it.
Are tables really only to be used for statistics on the consumption
of cabbage in East Berlin from 1993 to 1994?
Of course not. They''re also to be used for presenting sales of Lee
Perry cds in London; pollution levels in Mexico City; films produced
in India, France, and the U.S.; etc.
where is it written, actually literally where in the W3 website
or the spec is it written that I must use CSS-P now or my code
isn''t using standards?
In the HTML 4 recommendation, of course.

http://www.w3.org/TR/html4/struct/tables.html

See the first section, "introduction to tables."
the woman who I was arguing with eventually just said "well, you''re
going against the SPIRIT of it"
Abusing tables for their presentation is a violation of HTML...
and I said "I don''t have a Spirit Validator, just an HTML
Validator".



....but such abuse of tables does not violate the syntax of the
language. The best article I''ve read on this topic is from J. Korpela:

http://www.cs.tut.fi/~jkorpela/html/validation.html
B. Pearson will be along shortly to try his best to confuse you with a
rant about the so-called history of html.

Good luck.

--
Brian (remove ".invalid" to email me)
http://www.tsmchughs.com/


"Jack Hughes" <ja********@yahoo.com> schrieb im Newsbeitrag
news:f4*************************@posting.google.co m...

This argument has come up two or three times lately.
[...]
I forgot my original question -- oh yeah, where is it written,
actually literally where in the W3 website or the spec is it written
that I must use CSS-P now or my code isn''t using standards?



?h - if you know the arguments, why do you ask again? You are free to use
whatever coding technique you feel comfortable with. You don''t need the ok
of ciwah/ciwas regulars, do you?

This is neither about a "must" nor about religion, it is just essential to
know how things are intended to be by the people who developed them, and it
is great to know good arguments for and also against doing thins this or
that way. It just makes you free to decide which way you go and also it
gives you the ability to discuss this with your bosses, clients and
co-workers. So knowing about those issues makes you a professional. But it
is not necessary that you agree with all that is written here nor is it
necessary that anybody else agrees with your point of view.

--
Markus


ja********@yahoo.com (Jack Hughes) wrote in message news:<f4*************************@posting.google.c om>...

where is "Thou Shalt Use CSS-P" written



c.i.w.a.h

By a bunch of pinheads who only have the brains for one bandwagon, so
when they''ve jumped onto it, they can''t accept any value in any other
way of doing it.

Understand what you''re doing. Then make appropriate choices.

Blanket application of CSS everywhere is probably slightly better than
an equally consistent use of 1x1.gif, but neither is as good as doing
the right things, as circumstance demands.

Three column layout in CSS sucks, because float is dubious and so is
width or margin:auto. Go for the three column table, because it''s
good, it''s simple and it works. OTOH, a 5 column table because you
don''t understand margins or padding isn''t good.

If you work on authoring for mobile devices, you''ll start to really
see benefits from dumping table-bloat.


We sometimes forget just how clued-up the readers of c.i.w.a.h are -
even the idiots. You''ll be flamed hereabouts for the most trivial of
errors, yet out in the big world of corporate site building the level
of technical expertise and practice is still pitiful. I''ve got a
problem at the moment where I feed content form <corporate #1> to
<corporate #2> and they''re cheefully stripping ampersand entities and
all sorts from the content, then wondering why I complain that it''s no
longer valid HTML - "But it looks OK in my browser" they whine.


这篇关于在哪里写我应该使用CSS定位?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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