动网论坛,站长建站首选,国内使用量最多的论坛软件 动网论坛官方技术讨论区 站长工具 申请属于您自己的免费论坛
首页 | 新闻资讯 | 网站运营 | 网络编程 | 数据库 | 服务器 | 网页设计 | 图像媒体 | 网络应用 | 搜索优化 | 资源下载 | 动网主机
    本站内  互联网 ASP论坛  ASP.Net论坛  PHP论坛
   网页设计 → 阅读文章

 采用WEB标准时页面自适应的解决方案一则

作者来源: 
阅读 1705 人次 , 2006-2-16 14:55:00 

很多时候明明感觉应该自适应的效果,
可是在不同浏览器里却取得不同的结果,
这个时候最令人伤神。
有时利用“相对位置”和“绝对位置”方法来确定DIV的方位,
也是个很不错的想法,
至于如何使用,使用那种方法,
还是要看个人习惯以及网页整体要求。
来看看下面的方法,从中会掌握自适应的一种好方法。

XHTML
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
<head>
<title>Untitled Document</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<link href="2columngray.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="container">
 <div id="mainheader">
 <div class="blank2"></div>
 <!-- for decoration only -->
 </div>
 <div id="header">
 <p>Header content goes here</p>
 <p><a href="2col_left.htm">Left </a>column Longest</p>
 <p><a href="2col_right.htm">Right</a> column Longest</p>
 <p><a href="2col_main.htm">No</a> column longest</p>
 <p><a href="http://www.pmob.co.uk/temp/3colfixedtest_4.htm">Back</a> to main
 3 column demo</p>
 </div>
 <div id="mainnav">
 <p>Navigation</p>
 </div>
 <div id="sidebar">
 <p>Sidebar content goes here : Sidebar content goes here : Sidebar content
 goes here : Sidebar content goes here : Sidebar content goes here : Sidebar
 content goes here : Sidebar content goes here : Sidebar content goes here
 : Sidebar content goes here : Sidebar content goes here : Sidebar content
 goes here : Sidebar content goes here : </p>
 </div>
 <div id="content">
 <p>Footer stays at the bottom of the window unless the content is longer then
 it stays at the bottom of the document.</p>
 <p>Footer stays at the bottom of the window unless the content is longer then
 it stays at the bottom of the document.</p>
 </div>
 <div id="clearfooter"></div>
 <!-- to clear footer -->
 <div id="footer">
 <div class="divider1"></div>
 <div class="blank"></div>
 <!-- for decoration only -->
 <p>Footer Content</p>
 </div>
</div>
</body>
</html>  
 
 收藏本文  打印本文  论坛讨论  关闭窗口
· 上一篇:关于box(盒模式)的一系列问题
· 下一篇:CSS入门教程
· 揭开正则表达式语法的神秘面纱
· 动态网页技术
· 用DW中ToolTip代码改进的提示框
· HTML标签详解(4)
· 巧用CSS的Border属性制作特效菜单


关于本站 | 联系我们 | 业务合作 | 客户案例 | 诚聘英才 | 广告合作 | 收藏本站
海口动网先锋网络科技有限公司版权所有
Copyright © 2000 - 2006 Cndw.Com
中华人民共和国电信与信息服务业务经营许可证编号 琼 ICP 020077