frameset属性相关设置

frameset属性相关设置:

可以设置是否显示边框线,还可以设置边框的宽度和颜色。

1、frameborder属性

frameborder属性用于设置是否显示边框线,语法格式为:

   <frameset frameborder = 是否显示>或<frame frameborder = 是否显示>

frameborder的取值只能为0或1,1为默认值,表示显示;如果为0,则边框线会隐藏起来。在<frameset>中设置将对整个框架有效,在<frame>中设置则只对当前这个框架有效。
【例6】框架边框。

   <html>
   <head>
     <title>itsway -- 框架</title>
   </head>
   <frameset rows = "20%, 50%, 30%">
     <frame frameborder = "1"> <!--默认值-->
     <frameset cols = "35%,65%" frameborder = "0"> <!--无边框-->
       <frame>
       <frame>
     </frameset>
     <frame>
   </frameset>
   </html>

可以看到页面中间部分的边框被隐藏起来了。在IE浏览器中,当鼠标移动到窗口中间时会变成双箭头形状,此时按下鼠标就可以调整各窗格大小了,如下图所示。但在Firefox和Netscape中无效。

HTML教程

2、framespacing属性

当框架有边框时,边框宽度在默认情况下是1像素。IE规定,通过framespacing属性还可以调整其大小,格式为:

   <frameset framespacing = 边框宽度>

边框宽度就是在页面中各个边框之间的线条宽度,以像素为单位,并且这一属性只能在<frameset>中使用,对单个<frame>无效。
【例7】框架宽度。

   <html>
   <head>
     <title>itsway -- 框架</title>
   </head>
   <frameset rows = "30%, *" framespacing = "5">
     <frame>
     <frameset cols = "20%,*,20%" framespacing = "20">
       <frame>
       <frame>
       <frame>
     </frameset>
     <frame>
   </frameset>
   </html>

注意,此属性只在IE中有效,在Netscape、Firefox中无效。

3、bordercolor属性

使用bordercolor属性可以设置框架集的边框颜色,格式为:

   <frameset bordercolor = 边框颜色>

这一属性只能在<frameset>中使用,对单个<frame>无效。  【例8】框架边框颜色。

   <html>
   <head>
     <title>itsway -- 框架</title>
   </head>
   <frameset rows = "30%, *" framespacing = "5" bordercolor = "#cc99ff">
     <frame>
     <frameset cols = "20%,*,20%" framespacing = "20" bordercolor = "red">
       <frame>
       <frame>
       <frame>
     </frameset>
     <frame>
   </frameset>
   </html>

在Firefox中的显示结果如下图所示。

HTML教程

bordercolor属性在IE、Netscape和Firefox中都有效。但正如上图所显示的那样,framespacing属性在Firefox和Netspace中无效(在Netscape中的显示图略)。

4、scrolling和noresize属性

<frame>标记还有scrolling和noresize属性。scrolling用来指定是否显示滚动轴,取值可以为:
● yes:显示滚动轴。
● no:不显示滚动轴。
● auto:若需要则会自动显示滚动轴,不需要则自动不显示,是默认值。
noresize属性直接加入<frame>标志中即可使用,不需赋值,它用来禁止用户调整一个框架的大小。
【例9】使用scrolling和noresize属性。

   <html>
   <head>
     <title>itsway -- 框架</title>
   </head>
   <frameset cols = "150, *, 200">
     <frame scrolling = "yes" noresize src = "chap8_cat1.html">
     <frame scrolling = "no" src = "chap8_cat2.html">
     <frame scrolling = "auto" src = "chap8_cat3.html">
   </frameset>
   </html>

可以看出,当设置scrolling为yes时,滚动轴总会存在;当设置scrolling为no时,窗格中无滚动轴;设置scrolling为auto时,滚动轴会在需要的时候自动添加。读者可以缩放窗口自己试验。

  • 3
    点赞
  • 6
    收藏
    觉得还不错? 一键收藏
  • 1
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值