MarkdownPad Document

html, body, div, span, applet, object, iframe, h1, h2, h3, h4, h5, h6, p, blockquote, pre, a, abbr, acronym, address, big, cite, code, del, dfn, em, img, ins, kbd, q, s, samp, small, strike, strong, sub, sup, tt, var, b, u, i, center, dl, dt, dd, ol, ul, li, fieldset, form, label, legend, table, caption, tbody, tfoot, thead, tr, th, td, article, aside, canvas, details, embed, figure, figcaption, footer, header, hgroup, menu, nav, output, ruby, section, summary, time, mark, audio, video {

margin: 0;

padding: 0;

border: 0;

}

/* BODY

=============================================================================*/

body {

font-family: Helvetica, arial, freesans, clean, sans-serif;

font-size: 14px;

line-height: 1.6;

color: #333;

background-color: #fff;

padding: 20px;

max-width: 960px;

hight:500px;

margin: 0 auto;

}

body>*:first-child {

margin-top: 0 !important;

}

body>*:last-child {

margin-bottom: 0 !important;

}

/* BLOCKS

=============================================================================*/

p, blockquote, ul, ol, dl, table, pre {

margin: 15px 0;

}

/* HEADERS

=============================================================================*/

h1, h2, h3, h4, h5, h6 {

margin: 20px 0 10px;

padding: 0;

font-weight: bold;

-webkit-font-smoothing: antialiased;

}

h1 tt, h1 code, h2 tt, h2 code, h3 tt, h3 code, h4 tt, h4 code, h5 tt, h5 code, h6 tt, h6 code {

font-size: inherit;

}

h1 {

font-size: 28px;

color: #000;

}

h2 {

font-size: 24px;

border-bottom: 1px solid #ccc;

color: #000;

}

h3 {

font-size: 18px;

}

h4 {

font-size: 16px;

}

h5 {

font-size: 14px;

}

h6 {

color: #777;

font-size: 14px;

}

body>h2:first-child, body>h1:first-child, body>h1:first-child+h2, body>h3:first-child, body>h4:first-child, body>h5:first-child, body>h6:first-child {

margin-top: 0;

padding-top: 0;

}

a:first-child h1, a:first-child h2, a:first-child h3, a:first-child h4, a:first-child h5, a:first-child h6 {

margin-top: 0;

padding-top: 0;

}

h1+p, h2+p, h3+p, h4+p, h5+p, h6+p {

margin-top: 10px;

}

/* LINKS

=============================================================================*/

a {

color: #4183C4;

text-decoration: none;

}

a:hover {

text-decoration: underline;

}

/* LISTS

=============================================================================*/

ul, ol {

padding-left: 30px;

}

ul li > :first-child,

ol li > :first-child,

ul li ul:first-of-type,

ol li ol:first-of-type,

ul li ol:first-of-type,

ol li ul:first-of-type {

margin-top: 0px;

}

ul ul, ul ol, ol ol, ol ul {

margin-bottom: 0;

}

dl {

padding: 0;

}

dl dt {

font-size: 14px;

font-weight: bold;

font-style: italic;

padding: 0;

margin: 15px 0 5px;

}

dl dt:first-child {

padding: 0;

}

dl dt>:first-child {

margin-top: 0px;

}

dl dt>:last-child {

margin-bottom: 0px;

}

dl dd {

margin: 0 0 15px;

padding: 0 15px;

}

dl dd>:first-child {

margin-top: 0px;

}

dl dd>:last-child {

margin-bottom: 0px;

}

/* CODE

=============================================================================*/

pre, code, tt {

font-size: 12px;

font-family: Consolas, "Liberation Mono", Courier, monospace;

}

code, tt {

margin: 0 0px;

padding: 0px 0px;

white-space: nowrap;

border: 1px solid #eaeaea;

background-color: #f8f8f8;

border-radius: 3px;

}

pre>code {

margin: 0;

padding: 0;

white-space: pre;

border: none;

background: transparent;

}

pre {

background-color: #f8f8f8;

border: 1px solid #ccc;

font-size: 13px;

line-height: 19px;

overflow: auto;

padding: 6px 10px;

border-radius: 3px;

}

pre code, pre tt {

background-color: transparent;

border: none;

}

kbd {

-moz-border-bottom-colors: none;

-moz-border-left-colors: none;

-moz-border-right-colors: none;

-moz-border-top-colors: none;

background-color: #DDDDDD;

background-image: linear-gradient(#F1F1F1, #DDDDDD);

background-repeat: repeat-x;

border-color: #DDDDDD #CCCCCC #CCCCCC #DDDDDD;

border-image: none;

border-radius: 2px 2px 2px 2px;

border-style: solid;

border-width: 1px;

font-family: "Helvetica Neue",Helvetica,Arial,sans-serif;

line-height: 10px;

padding: 1px 4px;

}

/* QUOTES

=============================================================================*/

blockquote {

border-left: 4px solid #DDD;

padding: 0 15px;

color: #777;

}

blockquote>:first-child {

margin-top: 0px;

}

blockquote>:last-child {

margin-bottom: 0px;

}

/* HORIZONTAL RULES

=============================================================================*/

hr {

clear: both;

margin: 15px 0;

height: 0px;

overflow: hidden;

border: none;

background: transparent;

border-bottom: 4px solid #ddd;

padding: 0;

}

/* TABLES

=============================================================================*/

table th {

font-weight: bold;

}

table th, table td {

border: 1px solid #ccc;

padding: 6px 13px;

}

table tr {

border-top: 1px solid #ccc;

background-color: #fff;

}

table tr:nth-child(2n) {

background-color: #f8f8f8;

}

/* IMAGES

=============================================================================*/

img {

max-width: 100%

}

新浪布局


头部区域自适应
尾部区域自适应
中间区域固定宽度
包含两个固定宽度的模块,并且并列渲染
两个盒子,一个浮动,一个在文档流上
min-width 设置最小宽度
min-height 设置最小高度
max-width 设置最大宽度
max-height 设置最大高度



1/*解决显示不全的问题,我们可以设置最小宽度*/
2body {
3 min-width: 1000px;
4}
5* {
6 margin: 0;
7 padding: 0;
8}
9.header {
10 height: 100px;
11 background: red;
12}
13.container {
14 width: 1000px;
15 /*居中*/
16 margin: 0 auto;
17 background: yellow;
18}
19/*左边的盒子*/
20.left {
21 float: left;
22 width: 400px;
23 height: 500px;
24 background: gold;
25}
26/*右边的盒子*/
27.right {
28 /*固定宽度*/
29 /*width: 600px;*/
30 /*更好的方案是自适应*/
31 margin-left: 410px;
32 height: 400px;
33 background: green;
34}
35.footer {
36 height: 50px;
37 background: pink;
38}
39.clearfix:after {
40 /*设置内容*/
41 content: '';
42 display: block;
43 /*清除浮动*/
44 clear: both;
45}
46
47<body>
48 <div class="header"></div>
49 <div class="container clearfix">
50 <div class="left"></div>
51 <div class="right"></div>
52 </div>
53 <div class="footer"></div>
54</body>

变形
中间的内容区域自适应(例如:80%居中)
此时当页面小于内容区域最小盒子宽度的时候,头部和尾部显示不全了,
我们可以让页面的最小宽度不小于该宽度即可


HTML常用布局---新浪布局的更多相关文章

  1. html5新标签布局应用指南

    html5中为了便于设计者的网站布局新添加了一些标签,本文主要讲解这些标签的实际应用方法. 大多数前端的朋友在设计网站时主要应用<div>标签构造盒子进行布局,这是种非常高效的方法,可以将 ...

  2. html5 基本布局+新标签+新选择器 + 线性渐变

    html5 基本布局+新标签 <!DOCTYPE html> <html lang="en"> <head> <meta charset= ...

  3. Android中常用的5大布局详述

    Android的界面是有布局和组件协同完成的,布局好比是建筑里的框架,而组件则相当于建筑里的砖瓦.组件按照布局的要求依次排列,就组成了用户所看见的界面. 所有的布局方式都可以归类为ViewGroup的 ...

  4. Flex布局新旧混合写法详解(兼容微信)

    原文链接:https://www.usblog.cc/blog/post/justzhl/Flex布局新旧混合写法详解(兼容微信) flex是个非常好用的属性,如果说有什么可以完全代替 float 和 ...

  5. Android常用的四种布局(或者说是五种)

    一.FrameLayout(帧布局): 显示特点:所有的子控件默认显示在FrameLayout的左上角,会重叠在一起显示. 常用属性: layout_gravity(设置给子控件,调整控件在容器内的重 ...

  6. html5--2.9新的布局元素(6)-figure/figcaption

    html5--2.9新的布局元素(6)-figure/figcaption 学习要点 了解figure/figcaption元素的语义和用法 通过实例理解figure/figcaption元素的用法 ...

  7. html5--2.9新的布局元素(5)-hgroup/address

    html5--2.9新的布局元素(5)-hgroup/address 学习要点 了解hgroup/address元素的语义和用法 通过实例理解hgroup/address元素的用法 对照新元素布局与d ...

  8. html5--2.7新的布局元素(4)-time

    html5--2.7新的布局元素(4)-time 学习要点 了解微格式的概念 掌握time元素的用法 微格式的概念 HTML5中的微格式,是一种利用HTML5中的新标签对网页添加附加信息的方法,附加信 ...

  9. html5--2.6新的布局元素(5)-nav

    html5--2.6新的布局元素(4)-aside/nav 学习要点 了解aside/nav元素的语义和用法 通过实例理解aside/nav元素的用法 aside元素 aside元素通常用来设置侧边栏 ...

随机推荐

  1. 【iOS】Core Bluetooth

    本文介绍蓝牙4.0的一些基本知识. 基本概念.服务器.客户端 蓝牙LE是一个基于点对点的通信系统,其中一台设备作为服务器,另一台设备作为客户端.拥有数据的设备作为服务器,消费数据的设备作为客户端. 比 ...

  2. IOS开发之XCode学习014:警告对话框和等待提示器

    此文学习来源为:http://study.163.com/course/introduction/1002858003.htm 此工程文件实现功能:  1.警告对话框和等待提示器的概念 2.警告对话框 ...

  3. docker教程

    Docker 包括三个基本概念 镜像(Image) 容器(Container) 仏库(Repository) 理解了返三个概念,就理解了 Docker 的整个生命周期. Docker 镜像 Docke ...

  4. STL --> find()和find_if()

    find()和find_if() 一.find()函数 find(first, end, value); // 返回区间[first,end)中第一个值等于value的元素的位置.如果没有找到匹配元素 ...

  5. ElasticSearch的安装

    一.安装javaSE环境(已配java环境变量的请直接跳过) 1.从Java JDK 官网下载适合自己的jdk版本.(我自己用的jdk1.7) 2.安装jdk后,配置java环境变量(ps:比较喜欢简 ...

  6. sqlite语句主页

    因为现在android手机用sqlite数据,但是sql语句很多和sqlserver不同..所以还是把官网记下以便开发:http://www.sqlite.org/lang.html

  7. 【动态规划】记忆搜索(C++)

    前几天还在踟蹰我应该注重培养做项目的能力还是修炼算法以及数据结构,然后发现这个场景有点似曾相识.曾几何时的一个月里,我有三件比较重要的事情要解决,在那个月刚开始的时候我一直在想我应该从那件事情开始着手 ...

  8. 笔试常考--浏览器输入一个URL点击回车之后发生了什么

    解析URL:浏览器首先对拿到的URL进行识别,抽取出域名字段. DNS解析: 查询浏览器缓存(浏览器会缓存之前拿到的DNS 2-30分钟时间),如果没有找到, 检查系统缓存,检查hosts文件,这个文 ...

  9. Maven学习笔记一

    maven是apache下的一个开源项目,是纯java开发,并且只是用来管理java项目的. Maven好处 1.普通的传统项目,包含jar包,占用空间很大.而Maven项目不包含jar包,所以占用空 ...

  10. 解决python中flask_sqlalchemy包安装失败的问题

    在进行flask_sqlalchemy包的下载安装时出现以下问题: 由图片可看出是编码转换出了问题,找到pip\compat_init_.py文件,打开它并查看第73行,将代码做如下更改并保存: 问题 ...