DIV------使用 <div> 元素的网页布局
<!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> 元素的网页布局的更多相关文章
- 利用DIV,实现简单的网页布局
<html lang="en"><head> <meta charset="UTF-8"> <title>GIS ...
- 网页布局之Div
div(division分区) 它是一个块标签,主要用来把网页中相关的内容组织到一起 你可以把网页的头部放到一个标签中,主体部分放到另一个标签中 使用class类名描述div内容 要想区分每个div, ...
- 总结与学习DIV+CSS网页布局技巧
以前用表格布局时设置网页居中非常方便,把表格对齐方式设置为居中就行了,就这么简单,现在呢,用DIV+CSS样式表控制,好像不是那么容易了,其实也很简单,只不过方式不同而已. <style> ...
- DIV+CSS 网页布局之:混合布局
1.混合布局 在了解了一列.两列和三列布局之后,混合布局也就不难理解了,混合布局也可以叫综合型布局,那么混合布局就可以在一列布局的基础之上,分为两列布局,三列布局,网页布局的结构普遍都是三列布局,但是 ...
- DIV+CSS 网页布局之:一列布局
1.网页布局 布局(layout)即对事物的全面规划和安排,页面布局是对页面的文字.图像或表格进行格式化版式排列.网页布局对改善网站的外观非常重要,又称版式布局,大多数网站会把内容安排到多个列中,就像 ...
- 浅谈table和DIV网页布局
DIV+CSS是网站标准(或称“WEB标准”)中常用的术语之一,通常为了说明与HTML网页设计语言中的表格(table)定位方式的区别,因为XHTML网站设计标准中,不再使用表格定位技术,而是采用DI ...
- [转]CSS网页布局:div水平居中的各种方法
http://jingyan.baidu.com/article/fa4125ac90a2a328ac70929e.html 在Web标准中的页面布局是使用Div配合CSS来实现的.这其中最常用到的就 ...
- DIV+CSS常用网页布局技巧!
以下是我整理的DIV+CSS常用网页布局技巧,仅供学习与参考! 第一种布局:左边固定宽度,右边自适应宽度 HTML Markup <div id="left">Left ...
- 常见div+css网页布局(float,absolute)
网页布局-常见 1, float布局 (1)常规方法 <div id="warp"> <div id="column&quo ...
随机推荐
- IntraWeb.v14.0.32安装及破解指南
一.下载 首先从这里下载14.0.32版本的IntraWeb: 链接:http://pan.baidu.com/s/1c0rjnKO 密码:8kv2 二.卸载旧版 1. 我的Delphi版本是XE6, ...
- dyld: lazy symbol binding failed: Symbol not found: _objc_setProperty_nonatomic
这个错误,一般在高版本设备里面不会出现,而在低版本会出现比如你的项目或者引入的静态库的Deployment Target设置成了ios6.0而你的测试设备是ios5.0甚至更低,就会出现如上错误.因为 ...
- 【HDU2825】Wireless Password (AC自动机+状压DP)
Wireless Password Time Limit: 1000MS Memory Limit: 32768KB 64bit IO Format: %I64d & %I64u De ...
- 【 UVALive - 2197】Paint the Roads(上下界费用流)
Description In a country there are n cities connected by m one way roads. You can paint any of these ...
- lc面试准备:Partition List
1 题目 Given a linked list and a value x, partition it such that all nodes less than x come before nod ...
- 【HDOJ】5203 Rikka with wood sticks
/* 1002 */ #include <iostream> #include <string> #include <map> #include <queue ...
- Eclipse C/C++环境配置
一.C/C++环境配置: Window - Preferences - C/C++ 1. Editor - Content Assist - Auto-Activation - Delay(ms),原 ...
- HDU-2576 Tug of War
http://poj.org/problem?id=2576 二维数组01背包的变形. Tug of War Time Limit: 3000MS Memory Limit: 65536K Tot ...
- 【索引】Objective-C基础教程-读书笔记
第1章 启程 http://www.cnblogs.com/duxiuxing/p/5492219.html 第2章 对C的扩展 第3章 面向对象编程的基础知识 第4章 继承 第5章 复合 第6章 ...
- C++经典KMP算法的实现
#include <iostream> #include <algorithm> #include <vector> #include <string> ...