日期:2014-05-17  浏览次数:20677 次

html布局学习笔记

?

  • <frameset> 定义如何将窗口化分为框架(rows/cols),不能与body同在,否则不显示
  • <frame> ?定义框架要加载的html文档,需增加 noresize="noresize"属性防止有可见边框可随意拖动
  • <noframes> 用于不支持框架的浏览器?
综合以上三个标签示例如下:
<html>
<head>
<title>frame框架</title>
</head>

<frame>
<frameset rows="20%,*">
<frame src="top.htm" name="top" noresize="noresize">
<frameset cols="25%,75%">
<frame src="left.htm" name="left" noresize="noresize">
<frame src="main.htm" name="main" noresize="noresize">
</frameset>

<noframes>
<body>
您的浏览器不支持框架!
</body>
</noframes>
</frameset>
</frame>

</html>
  • ?所有跟样式有关都要放到单独的样式表.css中,通过link标签放到head标签内,并可引用到多个页面中。
<head>
<link rel="stylesheet" type="text/css" href="mystyle.css">
</head>
  • 当定义产生冲突时,CSS新式的生效规则是后定义的优先。优先级的顺序是:
  1. 在标签中加入CSS样式?
  2. 在<style></style>标签中加入css样式
  3. 导入样式@import url("index.css")或@import "index.css"
  4. 链入外部CSS样式表
  • 常用字符实体
结果 描述 实体名称 实体编号
非间断空格 &nbsp; &#160;
< 小于号 &lt; &#60;
> 大于号 &gt; &#62;
& and符号 &amp; &#38;
&cent; &#162;
英镑 &pound;