框架,框架集和CSS [英] Frames, Framesets and CSS

查看:70
本文介绍了框架,框架集和CSS的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述




问候所有人:


我正在尝试让CSS使用带框架的网页,但我不能。


有没有人知道CSS规范中所需的语法

来指定框架的属性?


理想情况下,我希望能够改变边框的厚度,颜色等。


另外,有没有人知道一些全面的例子/教程

那里有关于如何使用CSS?


提前感谢您的帮助。


- * - 一个令人困惑且有点沮丧的CSS新人 - * -

这是我对HTML(名为sample.html):


vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv vvvvvvvvvvvvvvvvvvvv

将DOCTYPE HTML PUBLIC <! br />
" - // W3C // DTD HTML 4.01 Frameset // EN"

" http://www.w3.org/TR/1999/REC-html401 -19991224 / frameset.dtd"


< html>

< head>

< link href =" sample.css"

rel =" stylesheet"

type =" text / css"



< / head>

< frameset rows =" 50%,*" cols =" 50%,*">

< frame name =" ul">

< frame name =" ur">

< frame name =" ll">

< frame name =" lr">

< / frameset> ;

< / html>


^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^


和这里是样式表(名为sample.css):


vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv vvvvvvvvvvvvvvvvvvvv


画面<无线电通信/>
{

bordercolor:#ff0000

frameborder:是

border:50

}

FRAMESET

{

bordercolor:#00ff00

frameborder:yes

border :25

}


^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^

解决方案

x< news:40 ************** @ dev.null>:
我试图让CSS与框架网页一起工作,但我不能。

有谁知道CSS规范中所需的语法
指定框架的属性?


http://www.w3.org/Style/CSS/
http://www.htmlhelp.com/reference/css/

-

Rob - http://rock13.com/

网页资料: http://rock13.com/webhelp/


2004年4月1日星期四,格林尼治标准时间22:26:12,x< x@dev.null>写道:



大家问候:

我正在尝试使用框架网页来处理CSS,但我不能。

是否有人知道CSS规范中所需的语法
来指定帧的属性?


WC3知道。所有有效的CSS属性都列在
http:// www.w3.org/TR/CSS2/propidx.html


FRAME
{
bordercolor:#ff0000
frameborder:是的
边框:50

FRAMESET
{
bordercolor:#00ff00
frameborder:是
边框:25
}



看,你刚刚搞砸了。它不会那样工作。


我的理解是CSS不会影响框架集文档。我基于

完全没有回想起CSS规范中提到的任何frameset实例

,所以我可能会出错。我欢迎更正。


Neal< ne ***** @ spamrcn.com>写道:

我的理解是CSS不会影响框架集文档。我完全基于没有回忆CSS规范中提到的任何frameset实例,所以我可能会出错。




CSS规范不讨论框架集*),但这不会将它们排除在CSS的适用范围之外。 CSS 2规范中的HTML 4样本样式

表格也为

FRAMESET,FRAME等设置了一些属性。 (没什么好看的,只是像

显示:块,但仍然。)

*)在讨论定位时,CSS 2规范提到的功能可以是

用于创建类似框架的演示文稿,但这并不意味着

框架集本身不会受到CSS的影响。


那里用CSS来制作一个框架集并不多。*)有人可能会尝试

设置框架的宽度和高度,但这通常比

便宜只是在标记中这样做 - 并且可能导致浏览器

混乱我很害怕。

*)需要记住样式表只影响文档,

不是它嵌入的任何文档,通过FRAME元素或其他方式。所以

你不能例如为少数支持CSS的高级noframes浏览器设置有效的字体大小,除了NOFRAMES

部分。


设置边框是一个特殊问题。由于框架集渲染没有用CSS术语描述,即使在HTML 4的有些模糊的样本样式

表中,我们也不知道如何影响它在CSS中,除了

试验和错误,并且知道在一个浏览器上运行的任何内容可能会失败

在另一个浏览器上。至少对于IE,可以设置

边框的颜色和宽度,如下所示:

- 使用非标准HTML属性删除所有框架边框

(< frameset ... frameborder =" 0" border =" 0" framespacing =" 0">)

- 使用标准CSS来建议您喜欢的边框框架

元素。

参见 http://www.cs.tut.fi/~jkorpela/tekoik/keh.html 进行演示。

它使用三帧和一组一些彩色边框:


frame {border:solid#090 0; }

#f1 {border-right-width:medium; }

#f2 {border-bottom-width:medium; }


注意:f1和f2被定义为< frame id =" f1" ...取代。 id

属性值不一定是描述性的,不像名称属性

框架元素的值 - 请记住名称值将被说成

使用语音浏览器的人,使用Lynx等显示给人们。

所以他们应该简短但内容丰富,并且自然地在文档的

语言中。这就是为什么使用id

属性来引用CSS中的帧很方便的原因,特别是因为在CSS

选择器中,最好只使用Ascii字符。


我不是特别喜欢彩色边框边框的想法。它让我

询问滚动条是否也应该是彩色的,然后我就在路上

to hel ^ H ^ H ^为我自己创建一个用户界面而不是用户。

此外,这会有点不方便,因为显然我会将b $ b $(特定于IE)滚动条属性设置放入

body {...}规则在每个框架文档的样式表中,而不是

(我最初预期)到样式表中的框架{...}规则

框架集文档。这意味着我需要单独的

版本的框架文件,这是我通常会避免的。


-

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




Greetings everyone:

I am trying to get CSS to work with a framed web page, but I cannot.

Does anyone know the syntax required in a CSS specification
to specify attributes of the frames?

Ideally, I want to be able to change the border thickness, colour, etc.

Additionally, does anyone know of some comprehensive examples/tutorial
out there about how to use CSS?

Thanks in advance for your assistance.

-*- a puzzled and somewhat frustrated newcomer to CSS -*-
This is what I have for the html (named sample.html):

vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv vvvvvvvvvvvvvvvvvvvv
<!doctype html public
"-//W3C//DTD HTML 4.01 Frameset//EN"
"http://www.w3.org/TR/1999/REC-html401-19991224/frameset.dtd"

<html>
<head>
<link href = "sample.css"
rel = "stylesheet"
type = "text/css"


</head>
<frameset rows = "50%,*" cols = "50%,*">
<frame name = "ul">
<frame name = "ur">
<frame name = "ll">
<frame name = "lr">
</frameset>
</html>

^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^

and here is the style sheet (named sample.css):

vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv vvvvvvvvvvvvvvvvvvvv

FRAME
{
bordercolor : #ff0000
frameborder : yes
border : 50
}
FRAMESET
{
bordercolor : #00ff00
frameborder : yes
border : 25
}

^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^

解决方案

x <news:40**************@dev.null>:

I am trying to get CSS to work with a framed web page, but I
cannot.

Does anyone know the syntax required in a CSS specification
to specify attributes of the frames?



http://www.w3.org/Style/CSS/
http://www.htmlhelp.com/reference/css/

--
Rob - http://rock13.com/
Web Stuff: http://rock13.com/webhelp/


On Thu, 01 Apr 2004 22:26:12 GMT, x <x@dev.null> wrote:



Greetings everyone:

I am trying to get CSS to work with a framed web page, but I cannot.

Does anyone know the syntax required in a CSS specification
to specify attributes of the frames?
The WC3 knows. All the valid CSS properties are listed at
http://www.w3.org/TR/CSS2/propidx.html .

FRAME
{
bordercolor : #ff0000
frameborder : yes
border : 50
}
FRAMESET
{
bordercolor : #00ff00
frameborder : yes
border : 25
}


See, you''re just making shit up. It doesn''t work that way.

It''s my understanding that CSS does not affect frameset documents. I base
that solely on not recalling any instance of frameset ever being mentioned
in the CSS specs, so I may be in error. I welcome correction.


Neal <ne*****@spamrcn.com> wrote:

It''s my understanding that CSS does not affect frameset documents. I
base that solely on not recalling any instance of frameset ever being
mentioned in the CSS specs, so I may be in error.



The CSS specifications do not discuss framesets*), but this does not
exclude them from the scope of applicability of CSS. And the sample style
sheet for HTML 4 in the CSS 2 specification sets some properties for
FRAMESET, FRAME, etc., too. (Nothing fancy, just things like
display: block, but still.)
*) In discussing positioning, CSS 2 spec mentions features that can be
used "to create frame-like presentations", but this does not imply that
framesets themselves could not be affected by CSS.

There''s not much one can do with CSS to a frameset.*) One might try
settings widths and heights for the frames, but this is usually less
convenient than just doing so in markup - and could cause browser
confusion I''m afraid.
*) One needs to remember that a style sheet affects the document only,
not any document that it embeds, via the FRAME element or otherwise. So
you cannot e.g. set the font size effectively, except for the NOFRAMES
part, for the few advanced noframes-capable CSS-enabled browsers.

Setting borders is a special problem. Since frameset rendering has not
been described in CSS terms, even in the somewhat obscure sample style
sheet for HTML 4, we don''t really know how to affect it in CSS, except by
trial and error, and knowing that whatever works on one browser may fail
on another. For IE at least, it is possible to set the color and width of
borders as follows:
- use nonstandard HTML attributes to remove all frame borders
(<frameset ... frameborder="0" border="0" framespacing="0">)
- use standard CSS to suggest the borders you like for the frame
elements.
See http://www.cs.tut.fi/~jkorpela/tekoik/keh.html for a demo.
It uses three frames and sets some colored borders:

frame { border: solid #090 0; }
#f1 { border-right-width: medium; }
#f2 { border-bottom-width: medium; }

Note: f1 and f2 have been defined as <frame id="f1" ...>. The id
attribute values need not be descriptive, unlike the name attribute
values for frame elements - remember that name values will be spoken to
people using speech browsers, displayed to people using Lynx, etc.
So they should be short but informative of content, and naturally in the
language of the document. This is why it is convenient to use id
attributes for referring to the frames in CSS, especially since in CSS
selectors, it''s best to use Ascii characters only.

I don''t particularly like the idea of colored frames borders. It makes me
ask whether the scrollbars should be colored too, and then I''m on the way
to hel^H^H^Hcreating a user interface for myself and not for users.
Besides, that would be somewhat inconvenient, since apparently I would
need to put the (currently IE specific) scrollbar property settings into
body { ... } rules in a style sheet for each framed document, rather than
(as I first expected) into a frame { ... } rule in a style sheet for the
frameset document. And this would imply that I need to have separate
versions of the documents for framing, something that I normally avoid.

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


这篇关于框架,框架集和CSS的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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