<!DOCTYPE html>
<html>
<head>
<style type="text/css">
div#container{width:500px;}
div#header {background-color:#99bbbb;}
div#menu {background-color:#ffff99;height:200px;width:150px;float:left;}
div#content {background-color:#EEEEEE;height:200px;width:350px;float:left;}
div#footer {background-color:#99bbbb;clear:both;text-align:center;}
h1 {margin-bottom:0;}
h2 {margin-bottom:0;font-size:18px;}
ul {margin:0;}
li {list-style:none;}//注意:不是<li>
</style>
</head> <body> <div id="container"> <div id="header">
<h1>Main Title of Web Page</h1>
</div> <div id="menu">
<h2>Menu</h2>
<ul>
<li>HTML</li>
<li>CSS</li>
<li>JavaScript</li>
</ul>
</div> <div id="content">Content goes here</div> <div id="footer">Copyright W3School.com.cn</div> </div> </body>
</html>

法二:利用<table>实现

    即使可以使用 HTML 表格来创建漂亮的布局,但设计表格的目的是呈现表格化数据 - 表格不是布局工具!

<!DOCTYPE html>
<html>
<body> <table width="500px">
<tr >
<td colspan="2" style="background-color:#99bbbb;">//colspan 在td里定义,style里用:分隔,外边用空格分隔。
<h1>Main Title of Web Page<h1>
</td>
</tr> <tr valign="top">//valign什么意思
<td style="background-color:#ffff99;width:100px;text-align:top;">//style写在td里吗
<b>Menu</b></br>
HTML</br>
CSS</br>
JavaScript
</td>
<td style="background-color:#EEEEEE;height:200px;width:400px;text-align:top;">
Content goer here
</td>
</tr> <tr>
<td colspan="2" style="background-color:#99bbbb;text-align:center">
Copyright W3School.com.cn
</td>
</tr>
</table> </body>
</html>

参见:http://www.w3school.com.cn/html/html_layout.asp

DIV------使用 <div> 元素的网页布局的更多相关文章

  1. 利用DIV,实现简单的网页布局

    <html lang="en"><head> <meta charset="UTF-8"> <title>GIS ...

  2. 网页布局之Div

    div(division分区) 它是一个块标签,主要用来把网页中相关的内容组织到一起 你可以把网页的头部放到一个标签中,主体部分放到另一个标签中 使用class类名描述div内容 要想区分每个div, ...

  3. 总结与学习DIV+CSS网页布局技巧

    以前用表格布局时设置网页居中非常方便,把表格对齐方式设置为居中就行了,就这么简单,现在呢,用DIV+CSS样式表控制,好像不是那么容易了,其实也很简单,只不过方式不同而已. <style> ...

  4. DIV+CSS 网页布局之:混合布局

    1.混合布局 在了解了一列.两列和三列布局之后,混合布局也就不难理解了,混合布局也可以叫综合型布局,那么混合布局就可以在一列布局的基础之上,分为两列布局,三列布局,网页布局的结构普遍都是三列布局,但是 ...

  5. DIV+CSS 网页布局之:一列布局

    1.网页布局 布局(layout)即对事物的全面规划和安排,页面布局是对页面的文字.图像或表格进行格式化版式排列.网页布局对改善网站的外观非常重要,又称版式布局,大多数网站会把内容安排到多个列中,就像 ...

  6. 浅谈table和DIV网页布局

    DIV+CSS是网站标准(或称“WEB标准”)中常用的术语之一,通常为了说明与HTML网页设计语言中的表格(table)定位方式的区别,因为XHTML网站设计标准中,不再使用表格定位技术,而是采用DI ...

  7. [转]CSS网页布局:div水平居中的各种方法

    http://jingyan.baidu.com/article/fa4125ac90a2a328ac70929e.html 在Web标准中的页面布局是使用Div配合CSS来实现的.这其中最常用到的就 ...

  8. DIV+CSS常用网页布局技巧!

    以下是我整理的DIV+CSS常用网页布局技巧,仅供学习与参考! 第一种布局:左边固定宽度,右边自适应宽度 HTML Markup <div id="left">Left ...

  9. 常见div+css网页布局(float,absolute)

    网页布局-常见 1,           float布局 (1)常规方法 <div id="warp">     <div id="column&quo ...

随机推荐

  1. Ipv6_Only-b

    网上好多关于ipv6的资料,说半天ipv6是什么,怎么建立测试环境,,,可是没有看到具体的操作和解决的方案,这里,为大家提供一种方案,希望给大家带来帮助吧. 总的来说有三个方面需要进行检查和修改: 1 ...

  2. TCP带外数据读写

    #include <sys/socket.h> #include <netinet/in.h> #include <arpa/inet.h> #include &l ...

  3. 原生js实现吸顶导航和回到顶部特效

    <!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8&quo ...

  4. shell抓取

    #!/bin/sh ` configDir="$dir/config" ipport="$configDir/ip_port" url="http:/ ...

  5. Hive的Metastore contains multiple versions

    hive 客户端报错:Exception in thread "main" java.lang.RuntimeException: java.lang.RuntimeExcepti ...

  6. nutch 1.7 修改代码后如何编译发布,并集群采集攻略

    nutch 1.3之后,分布式的可执行文件与单机可执行文件进行了分离 接上篇,nutch 1.7 导入 eclipse 本篇所要解决的问题:nutch下载下来经过简单的配置即可进行采集,但有时候我们需 ...

  7. 解决File.delete()删除不掉文件

    首先注意两点: 此文件被使用的时候无法删除(比如网络输出没关闭流) 判断此文件是否存在再做删除(exists) 删除文件夹之前先删除文件夹下的所有文件(递归解决) 判断是否删除成功会有返回值,文件名错 ...

  8. Android 使用HttpClient方式提交GET请求

    public void httpClientGet(View view) { final String username = usernameEditText.getText().toString() ...

  9. leetcode面试准备: Jump Game

    1 题目 Given an array of non-negative integers, you are initially positioned at the first index of the ...

  10. 从 mian 函数开始一步一步分析 nginx 执行流程(二)

    如不做特殊说明,本博客所使用的 nginx 源码版本是 1.0.14,[] 中是代码所在的文件! 上一个博客中我们将 main 函数执行流程分析完,到最后一步调用 ngx_master_process ...