将表示HTML映射到CSS:摘要 [英] Mapping presentational HTML to CSS: a summary

查看:65
本文介绍了将表示HTML映射到CSS:摘要的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

由于没有关于如何将表示

HTML元素和属性映射到CSS的权威规范,甚至没有非正式描述(因为我可以看到

) ,我最后写了一篇:
http:// www .cs.tut.fi / ~jkorpela / html2css.html

想法是创造一些简单的东西,但现在看起来很混乱。

无论如何,也许它有一些用处。我不建议将旧页面转换为b $ b(使用表示HTML),但一般情况下,人们会这样做,但是人们似乎经常会问这样的问题。 什么是

valign in CSS?


-

Jukka K. Korpela(" Yucca" ;)
http://www.cs.tut.fi/ ~jkorpela /

Since there is no authoritative specification on how to map presentational
HTML elements and attributes to CSS, and even no informal description (as
far as I can see), I finally composed one:
http://www.cs.tut.fi/~jkorpela/html2css.html

The idea was to create something simple, but now it looks rather messy.
Anyway, maybe it''s of some use. I do _not_ recommend converting old pages
(using presentational HTML) to anything, in general, but people do such
things anyway, and people seem to ask rather often questions like "what''s
valign in CSS?"

--
Jukka K. Korpela ("Yucca")
http://www.cs.tut.fi/~jkorpela/

推荐答案

2007-05-23,Jukka K. Korpela< jk **** **@cs.tut.fiwrote:
On 2007-05-23, Jukka K. Korpela <jk******@cs.tut.fiwrote:

由于没有关于如何将表示

HTML元素和属性映射到CSS的权威规范,甚至没有非正式的描述(就像我能看到的那样),我终于写了一篇:
http://www.cs.tut.fi/~jkorpela/html2css.html


这个想法是为了cr吃一些简单的东西,但现在看起来很乱。

无论如何,也许它有一些用处。我不建议将旧页面转换为b $ b(使用表示HTML),但一般情况下,人们会这样做,但是人们似乎经常会问这样的问题。 什么是

valign in CSS?
Since there is no authoritative specification on how to map presentational
HTML elements and attributes to CSS, and even no informal description (as
far as I can see), I finally composed one:
http://www.cs.tut.fi/~jkorpela/html2css.html

The idea was to create something simple, but now it looks rather messy.
Anyway, maybe it''s of some use. I do _not_ recommend converting old pages
(using presentational HTML) to anything, in general, but people do such
things anyway, and people seem to ask rather often questions like "what''s
valign in CSS?"



< br style =" clear:两个" for< br clear =" all是一个有趣的。

Clear只应用于块级元素。

的值显示为< bris未在CSS 2.1的附录D中指定,这使得

为默认值,内联,这也是我所期望的。所以

从技术上讲,设置clear属性<被忽略,

就像你在< spanor< em>上设置它一样。但大多数浏览器

我试过允许它,作为使用clear属性的替代方法。


我想你可以有< div style = clear:both>< / div>。

之后的内容清算div将启动一个新的匿名块嵌套在你所在的那个

里面。这大部分都是等价的,但我认为含糊不清

当涉及到包含块时。


在这个例子中,


< div style =" height:400px" >你好

< div style =" clear:both">< / div>

world

< div style =高度:50%;宽度:20px; background-color:blue">< / div>

< / div>


50%是什么意思?这取决于第二个div的包含块

:具有固定高度的外部div或者在world之前开始的

自动高度匿名块;?如果是后者,那么应该忽略50%。


但是在这种情况下:


< div style =" height:400px"> Hello

< br clear =" all">

world

< div style =" height:50%;宽度:20px; background-color:blue">< / div>

< / div>


50%应该绝对算是200px,因为有没有歧义

关于哪个块是第二个div的包含块。 < br>

只是一个内联元素,会导致换行,并且没有

匿名块。


所以浏览器应该以不同的方式对待这两个例子。如果

他们应该,那么没有相当于< br clear =" all">的CSS。


狡辩是你说的 ; border-spacing:npx"对于每个细胞。但是你

在桌子上设置边框间距,而不是在单元格上,并且它实际上是表格的

属性。

<br style="clear: both"for <br clear="all"is an interesting one.
Clear is only supposed to apply to block-level elements. The value of
display for <bris not specified in Appendix D of CSS 2.1, which makes
it the default, inline, which is also what I would expect. So
technically, setting the clear property on <brought to be ignored,
just as it would be if you set it on <spanor <em>. But most browsers
I''ve tried allow it, as an alternative to using the clear attribute.

I suppose you could have <div style="clear: both"></div>. Content after
the clearing div will start a new anonymous block nested inside the one
you were in. That is mostly equivalent but there are I think ambiguities
here when it comes to containing blocks.

In this example,

<div style="height: 400px">Hello
<div style="clear: both"></div>
world
<div style="height: 50%; width: 20px; background-color: blue"></div>
</div>

should the 50% mean anything? It depends what is the containing block
for the second div: the outer div, which has a fixed height or the
auto-height anonymous block that begins before "world"? If the latter,
the 50% should be ignored.

In this case however:

<div style="height: 400px">Hello
<br clear="all">
world
<div style="height: 50%; width: 20px; background-color: blue"></div>
</div>

the 50% should definitely work out as 200px since there is no ambiguity
about which block is the containing block for the second div. The <br>
is just an inline element which causes a line break and there are no
anonymous blocks.

So arguably browsers should treat these two examples differently. If
they should, then there is no CSS equivalent to <br clear="all">.

A quibble is that you say "border-spacing: npx" for each cell. But you
set border-spacing on the table, not on the cells, and it is really a
property of the table.


Jukka K. Korpela写道:
Jukka K. Korpela wrote:

由于没有关于如何映射的权威规范

表示HTML元素和CSS的属性,甚至没有非正式的

描述(据我所知),我终于写了一个:
http://www.cs.tut.fi/~jkorpela/html2css.html



很好,Jukka,谢谢。我还没有意识到这样的事情已经不是这样的了。我想在about.com或者/ b $ b上可能会有类似的东西,但这样做会非常非权威。不是吗?

Nice, Jukka, thanks. I hadn''t realized there wasn''t something like this
around already. I guess there''s probably something on about.com or
similar, but that''d be rather "non-authoritative," wouldn''t it?


>

想法是创造一些简单的东西,但现在它看起来相当混乱。
>
The idea was to create something simple, but now it looks rather messy.



嗯,它可能会在顶部有点文字介绍,即使

它只是一个小费可见传说[链接]如下。

Well, it could stand a bit of a textual introduction at the top, even if
it''s only a tip to see the Legend [linked] below.


无论如何,也许它有一些用处。我不建议将旧的

页面(使用表现性HTML)转换成任何东西,但总的来说,无论如何人们都会这样做,而人们似乎经常会问这样的问题。

"什么是CSS中的valign?"
Anyway, maybe it''s of some use. I do _not_ recommend converting old
pages (using presentational HTML) to anything, in general, but people do
such things anyway, and people seem to ask rather often questions like
"what''s valign in CSS?"



我收集这是你对应该工作的东西的描述

等价,没有太多考虑浏览器错误或缺少支持

一个或另一个UA。您可能希望更清楚地说明您要列出的CSS级别是多少。从你的第一张纸条看来,你刚刚从CSS橱柜里拿出了相当于
的等价物,没有提到它是否来自2.1抽屉或3.0抽屉里的



是否有像fontlist和htmlsize这样的术语的通用定义,

或者我们应该知道你的意思(我_do_,但我'' m还

强制性足以检查解释或链接,我没看到

一个)?


出于某种原因,当我尝试在FF中打印页面时,第一个打印的

页面在表内容的第一个rox之后结束(元素

align =" bottom" >)。第二页以< element align =" center">,

开头,所有其他页面都打印了大量内容。我不明白为什么,而且我的其他浏览器似乎没有这个问题,所以我想我的安装只是

a bug在这里。


勘误:


1)搜索

< span class =" x"> ; foo< / band你还要写.x {

font-weight:bold;


将/ b更改为/ span。

添加一个右大括号}。


2)搜索

下标可能会改变和表达的含义。


从和中删除d。


3)搜索

功能而非演示。

可能会更改为presentational。


感谢分享,Jukka。


-

John

I gather this is your description of things which should work
equivalently, without much regard for browser bugs or lack of support in
one or the other UA. You might want to make clearer what level(s) of CSS
you are listing. From your first note it seems you''ve just grabbed
equivalents out of the CSS cupboard, without mentioning whether it came
out of the 2.1 drawer or the 3.0 drawer.

Is there some universal definition for terms like fontlist and htmlsize,
or are we just supposed to know what you mean (I _do_, but I''m also
compulsive enough to check for the explanation or link, and I don''t see
one)?

For some reason, when I try to print the page in FF, the first printed
page ends after the first rox of table content (element
align="bottom">). The second page starts with <element align="center">,
and all of the other pages print full of content. I don''t see why, and
my other browsers don''t seem to have this problem, so I guess it''s just
a bug in my installation here.

Corrigenda:

1) Search for
<span class="x">foo</band you would additionally write .x {
font-weight: bold;

Change the /b to /span.
Add a closing brace }.

2) Search for
subscripting may change the meaning of and expression.

Remove the d from "and".

3) Search for
functional rather than presentation.

Possibly change to "presentational".

Thanks for sharing, Jukka.

--
John


5月23日下午2:50,Jukka K. Korpela < jkorp ... @ cs.tut.fiwrote:
On May 23, 2:50 pm, "Jukka K. Korpela" <jkorp...@cs.tut.fiwrote:

由于没有关于如何映射表示的权威规范

HTML元素和CSS的属性,甚至没有非正式的描述(就像我可以看到的那样),我终于编写了一个: http://www.cs.tut.fi/~jkorpela/html2css.htm



基本链接断开

你有bf在标题的id但是basefont在锚点'href。

the basefont link is broken
you have "bf" in id of heading but "basefont" in anchor''s href.


这篇关于将表示HTML映射到CSS:摘要的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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