表示该网页版本为HTML5,文档声明写在网页最开始的地方。不区分大小写十进制:
- 特点:满10进1
- 计数:0 1 2 3 4 5 6 7 8 9
- 单位位数:10个(0 ~ 9)
- 扩展:日常使用就是十进制
二进制:
- 特点:满2进1
- 计数:0 1 10 11 100 101 110 111
- 单位位数:2个(0和1)
- 扩展:
计算机底层就是使用二进制来存储和计算的
可以将内存想象成一个有多个小格子的容器,每一个小格只能存0或者1,即1bit
8 bit = 1 byte
1024 byte = 1kb(千字节)
1024 kb = 1mb(兆字节)
1024mb = 1gb(吉字节)
1024gb = 1tb(特字节)
1024tb = 1pb(拍字节)
八进制:很少用
- 特点:满8进1
- 计数:0 1 2 3 4 5 6 7 10 11 12 13 14 15 16
- 单位位数:8个(0 ~ 7)
十六进制:
- 特点:满16进1
- 计数:0 1 2 3 4 5 6 7 8 9 a b c d e f 1a 1b 1c 1d ...
- 单位位数:16个(0 ~ f)
为了防止乱码问题的发生,在head标签中通过 指定字符集
鲁迅 ->> 1001010101 (编码)
1001010101 ->> 鲁迅 (解码)
所有的数据在计算机中都是以二进制形式进行存储的,包括文字、图像等。
所以一段文字在计算机中存储时,都需要转换成二进制编码。
当我们读取这段文字时,计算机会将编码转换成字符,供我们阅读。
- 编码:将字符转换成成二进制的过程
- 解码:将二进制转换成字符的过程
- 字符集:编码和解码所使用的规则称为字符集
- 常用字符集:
ASCII
ISO88591
GB2312
GBK
- 乱码:如果编码和解码所使用的字符集不一致就会造成乱码问题
https://wwr.lanzoui.com/iQhP5urk3gbac,这个时候就成了标签&实体名;DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>实体title>
head>
<body>
<p>今天天 气真热啊p>
<p>a<b>cp>
body>
html>
定义:meta主要设置网页中的一些元数据,元数据不是给用户看的
meta标签常用属性:
,隔开
url="url=https://www.baidu.com" 表示要跳转的url。 ```
示例
DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="keywords" content="HTML,CSS3,前端">
<meta name="title" content="磊子解忧百货铺">
<meta name="description" content="这是一个淘宝店铺!商品非常便宜">
<meta http-equiv="refresh" content="3,url=https://www.baidu.com">
<title>metatitle>
head>
<body>
body>
html>
块元素:在网页中独占一行的元素
h1~h6:h1元素最重要,h6最不重要p:段落标签hgroup:标题组标签div:万能的块元素blockquote:长引用元素行内标签:在网页中不独占一行的元素
em:表示语音语调的一个加重元素strong:表示强调重要内容的元素span:行内标签q:短引用元素br:换行元素HTML5新出的语义标签:
header:页眉main:文档著内容footer:页脚nav:导航标签aside:侧边栏标签article:表示一个独立的文章section:表示一个独立的区块注意:
1. 一般在块元素中放行内元素,而不会在行内元素中放块元素
2. p标签中不嵌套任何标签
3. 元素也称为标签,反之亦然。
列表标签分为三种:
ul(unorder list):无序列表
li(list item):列表项ol(order list):有序列表
li(list item):列表项dl(define list):定义列表(用的相对少)
dt(define title):定义的内容dd(define descrption):对定义内容的解释注意:
列表标签之间可以相互嵌套
DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>列表标签title>
head>
<body>
<ul>
<li>结构li>
<li>表现li>
<li>行为li>
ul>
<ol>
<li>结构li>
<li>表现li>
<li>行为li>
ol>
<ul>
<li>
江苏省
<ul>
<li>苏州li>
<li>无锡li>
<li>南京li>
ul>
li>
ul>
<dd>
<dt>行为dt>
<dd>不要拖拉,立即去做!dd>
dd>
body>
html>
a标签来定义href:指定跳转的目标路径
DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>超链接title>
head>
<body>
<a href="http://www.baidu.com">点击跳转到百度a>
<br><br>
<a href="05列表标签.html">点击跳转到内部页面a>
body>
html>
相对路径,一种是绝对路径。./和../两种写法。
./:表示当前文件所在目录,可以省略../:表示当前文件所在的上层目录。target属性:
_self:在当前页面进行跳转_blank:打开一个新的页面窗口进行跳转#id定位该标签所在位置
去底部,其中bottom是最后一个标签的id值#id值来进行当前页面的跳转无任何跳转的超链接:当我们只需要保留超链接样式,而不想进行任何跳转时就可以通过在href中写上javascript:;img,是一个自结束标签http://www.jsons.cn/img2base64/iframeaudio <audio controls>
<source src="./source/audio.ogg">
<source src="./source/audio.mp3">
audio>
video <video src="./source/flower.webm" controls autoplay loop>video>
embed <embed src="./source/flower.mp4" type="video/mp4" width="500" height="500">
使用内联样式(行内样式):在标签内部通过style属性来设置元素的样式,格式style="key:value;"
使用内部样式表:将样式编写到head标签的style标签中,然后通过CSS选择器来选中元素并为其设置各种样式
使用外部样式表(推荐使用):可以将css样式写到一个.css文件中,然后通过link来引入外部的css文件
选择器 声明块key:value;元素(标签名){}#id属性值{}.class属性值{}.blue{}、.red{}*{}*{}DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>常用选择器title>
<style>
/* 元素选择器 */
/* p{
color: tomato;
} */
/* id选择器 */
/* #p1{
font-size: large;
} */
/* 类选择器(class选择器) */
/* .a1{
color: blue;
} */
/* 通配选择器 */
*{
font-size: 30px;
}
style>
head>
<body>
<p id="p1">君不见黄河之水天上来,奔流到海不复回。p>
<p>君不见高堂明镜悲白发,朝如青丝暮成雪。p>
<p>人生得意须尽欢,莫使金樽空对月。p>
<p class="a1 b1">天生我材必有用,千金散尽还复来。p>
<p class="a1 ">烹羊宰牛且为乐,会须一饮三百杯。p>
<p> 岑夫子,丹丘生,将进酒,杯莫停。p>
<p>与君歌一曲,请君为我倾耳听。p>
<p>钟鼓馔玉不足贵,但愿长醉不复醒。p>
<p>古来圣贤皆寂寞,惟有饮者留其名。p>
<p>陈王昔时宴平乐,斗酒十千恣欢谑。p>
<p>主人何为言少钱,径须沽取对君酌。p>
<p>五花马、千金裘,呼儿将出换美酒p>
<p>与尔同销万古愁p>
body>
html>
交集选择器,一种是并集选择器
选择器1选择器2选择器3选择器n{}div.red{} 表示既是div标签并且class属性值为red的元素选择器1,选择器2,选择器3,选择器n{}div,red{} 表示选中只要元素是div或者class属性值为red的元素DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>复合选择器title>
<style>
/* 交集选择器 */
/* 表示 既是div标签并且class属性值为div1的元素 */
/* div.div1{
color: red;
} */
/* 并集选择器 */
/* 表示 只要是div元素或者class属性值为div1的元素 */
p,.div1{
color:blue;
}
style>
head>
<body>
<p>钟鼓馔玉不足贵,但愿长醉不复醒。p>
<div class="div1">古来圣贤皆寂寞,惟有饮者留其名。div>
body>
html>
父元素 > 子元素A > B /* 需求:给div的子元素span元素设置字体颜色为红色 */
div > span {
color: red;
}
祖先元素 后代元素A B /* 需求:给div中后代元素span设置字体颜色为blue */
div span {
color: blue;
}
A + B
div + p p + span {
font-size: 50px;
}
A ~ B
div ~ p p + span {
font-size: 50px;
}
p ~ span {
color: blue;
}
[属性名] 选择含有指定属性的元素[属性名=属性值] 选择含有指定属性并且还有值为指定值的元素[属性名^=xx] 选择含有指定属性名且属性值以xx开头的元素[属性名$=xx] 选择含有指定属性名且属性值以xx结尾的元素[属性名*=xx] 选择含有属性名且属性值包含xx的元素DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>属性选择器title>
<style>
/* 含有属性title的p元素 */
p[title] {
color: orange;
}
/* 属性title=abc的p元素 */
p[title=abc] {
color: blueviolet;
}
/* 属性title的值以a开头的p元素 */
p[title^=a] {
font-size: 40px;
}
/* 属性title的值以f结尾的p元素 */
p[title$=f] {
color: blue;
}
/* 属性title的值包含d的p元素*/
p[title*=d]{
color: red;
}
style>
head>
<body>
<p title="abc">君不见黄河之水天上来,奔流到海不复回。p>
<p title="edf">君不见高堂明镜悲白发,朝如青丝暮成雪。p>
<p>人生得意须尽欢,莫使金樽空对月。p>
<p>天生我材必有用,千金散尽还复来。p>
<p>烹羊宰牛且为乐,会须一饮三百杯。p>
<p> 岑夫子,丹丘生,将进酒,杯莫停。p>
<p>与君歌一曲,请君为我倾耳听。p>
<p>钟鼓馔玉不足贵,但愿长醉不复醒。p>
<p>古来圣贤皆寂寞,惟有饮者留其名。p>
<p>陈王昔时宴平乐,斗酒十千恣欢谑。p>
<p>主人何为言少钱,径须沽取对君酌。p>
<p>五花马、千金裘,呼儿将出换美酒p>
<p>与尔同销万古愁p>
body>
html>
:开头:first-child:第一个子元素:last-child:最后一个子元素:nth-child():第n个子元素
:fist-of-type:同类型中的第一个子元素last-of-type:同类型中的最后一个子元素nth-of-type: 同类型中的第n个子元素not():否定伪类,将符合条件的元素从选择器中排除ul > li:first-child {
color: red;
}
ul > li:last-child{
color: blue;
}
ul > li:nth-child(4){
color:green
}
ul > li:first-of-type{
color: aqua;
}
ul > li:not(:nth-of-type(3)) {
color: yellowgreen;
}
:link:未访问的超链接,该伪类只适用于超链接标签:visited:访问过的超链接,该伪类只适用于超链接标签:hover:当鼠标移入时发生的特殊状态(伪类):active:当鼠标点击时发生的特殊状态(伪类)
a:link{
color: red;
}
a:visited{
color: blue;
}
a:hover{
color: green;
}
a:active{
font-size: 50px;
}
::开头
::first-letter:表示第一个首字母::first-line:表示第一行::selection:表示选中的内容::before:元素第一个字符之前::after:元素最后一个字符之后::before和::after必须结合content属性来使用 p::first-letter {
font-size: 40px;
}
p::first-line {
color: bisque;
}
p::before{
content: "hello";
}
P::after{
content: "end";
color: red;
}
p::selection{
color: green;
}
祖先后代元素之间,是为了方便我们开发的backgroud-color

样式冲突。 .red{
background-color: red;
}
.blue{
background-color: yellowgreen;
}
"box1" class="red blue">我是div
!important ,则此时该样式会获取最高优先级,甚至超过内联样式,因此在开发中慎用!!!
颜色名,RGB值,RGBA,十六进制
R(red)、G(green)、B(blue)0 ~ 255(0% - 100%)之间rgb(红色,绿色,蓝色)R(red)、G(green)、B(blue)、A(不透明度)1 表示完全不透明、0表示完全透明,5半透明 #红色绿色蓝色00-ffH(hue) :色相,本质是一个圆环,范围是0-360(0和360为红色)S(saturation):饱和度,范围是0% ~ 100% L(lightness):亮度,范围是0% ~ 100% border-color:red blue green blue :依次表示上边框颜色红色,右边框颜色蓝色,下边框颜色绿色,左边框颜色blueborder-width:10px 20px 30px 40px四个值(顺时针方向):表示上宽度10px,右宽度20px,下宽度30px,左宽度40pxborder-width:10px 20px 30px 三个值:表示上宽度10px ,左右20px,下30pxborder-width:10px 20px两个值:表示上下10px,左右20pxborder-width:10px 一个值:表示上右下左都是10pxborder-xxx-width:
border-top-width:上边框宽度border-bottom-width:下边框宽度border-right-width:右边框宽度border-left-width:左边框宽度boder: 10px orange solid .box1{
/* 内容区属性 */
width: 100px;
height: 100px;
background-color: #afb;
/* 边框属性 */
border-width: 10px;
border-color: red;
border-style: solid;
}
内容区、内边距、边框构成padding-top:上内边距padding-right:右内边距padding-bottom:下内边距padding-left:左内边距padding:10px 20px 30px 40px 四个值:表示上内边距10px,右内边距20px,下内边距30px,左内边距40pxpadding 10px 20px 30px 三个值:表示上内边距10px,左右内边距20px,下内边距30pxpadding 10px 20px 两个值:表示上下内边距10px,左右内边距20px
margin-top:上外边距,设置一个正值,自身元素会向下移动margin-right:右外边距,默认情况下不会产生任何效果margin-bottom:下外边距,设置一个正值,会使下面的元素(其他元素)向下移动margin-left:左外边距,设置一个正值,自身元素会向右移动。margin可以设置四个方向的外边距,用法和padding一样margin 100px:四个方向的外边距100pxmargin 100px 200px 300px 400px:自身元素向下移动100px,向右移动400px,300px会使下面的元素向下移动300pxmargin 100px 200px 300px :该元素向下移动100px,向右移动200px,使下面的元素向下移动300pxmargin-left + border-left + padding-left + width + padding-right + border-right + margin-right = 其父元素的宽度auto的:
margin-left、margin-right、widthauto,则浏览器会自动调整margin-right值使等式成立100 + 0 + 0 + 200 + 0 + 0 + 0 = 800 ==> 100 + 0 + 0 + 200 + 0 + 0 + 500 = 800auto,则会自动调整auto的那个值使等式成立auto,则会调整宽度最大,其他的没有设置值的外边距会为0auto + 0 + 0 + auto + 0 + 0 + 200 = 600 ==> 0 + 0 + 0 + 600 + 0 + 0 + 200 = 800200 + 0 + 0 + auto + 0 + 0 + auto = 600 ==> 200 + 0 + 0 + 600 + 0 + 0 + 0 = 800auto + 0 + 0 + auto + 0 + 0 + auto = 600 ==> 0 + 0 + 0 + 800 + 0 + 0 + 0 = 800auto,则auto的外边距会自动均匀分配使等式成立auto + 0 + 0 + 200 + 0 + 0 + auto = 600 ==> 300 + 0 + 0 + 200 + 0 + 0 + 300 = 800 宽度固定,将margin-left和margin-right设置成auto .inner{
width: 200px;
height: 200px;
background-color: #afb;
margin-left: auto;
margin-right: auto;
}

子元素中设置属性overflow来处理溢出部分的内容,主要有以下三个:
visiable:可见的,对于溢出的部分依旧可以看见

hidden:隐藏,直接隐藏掉溢出的部分

scroll:以滚动条的形式来展示溢出的内容,这种方式水平垂直都会有滚动条

auto:根据元素宽度和内容自动调整是否在水平和垂直方向添加滚动条


margin-top和margin-bottom)取两者之间的较大值(两者都是正值) .box1,.box2{
width: 100px;
height: 100px;
}
.box1{
background-color: #afb;
margin-bottom: 100px;
}
.box2{
background-color: orange;
margin-top: 100px;
}
父元素的内边距,且修改父元素的height属性 .box3{
width: 200px;
/* ②修改子元素的width*/
height: 100px;
background-color: #afb;
/* ①改变父元素的内边距*/
padding-top: 100px;
}
.box4{
width: 100px;
height: 100px;
background-color: orange;
}

margin-top,且给父元素添加边框
.box3{
width: 200px;
height: 200px;
background-color: #afb;
/* 添加边框 */
border: #afb 1px solid;
}
.box4{
width: 100px;
height: 100px;
background-color: orange;
/* 上边距100px */
margin-top: 100px;
}

display属性将行内元素变成块元素实现:
display属性的可选值
inline : 将元素设置成行内元素block : 将元素设置成块元素inline-block: 将元素设置成行内块元素,既可以设置宽度和高度又可以不独占一行none:完全隐藏元素,即隐藏元素内容和样式visibility属性可选值:
visiable:元素可见,默认值hidden:隐藏元素内容,但保留元素样式 <p>我是段落标记p>
<p>我是段落标记p>
<p>我是段落标记p>
<p>我是段落标记p>
<p>我是段落标记p>
<div>哈哈哈哈哈div>
<ul>
<li>11111li>
<li>11111li>
<li>11111li>
ul>

F12查看盒子样式

可以看到盒子的外边距是8px。
去除浏览器默认样式的三种方法:
*{
margin: 0;
padding: 0;
/* 去除列表项的小黑点 */
list-style: none;
}
"stylesheet" href="assets/reset.css">

/* http://meyerweb.com/eric/tools/css/reset/
v2.0 | 20110126
License: none (public domain)
*/
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;
font-size: 100%;
font: inherit;
vertical-align: baseline;
}
/* HTML5 display-role reset for older browsers */
article, aside, details, figcaption, figure,
footer, header, hgroup, menu, nav, section {
display: block;
}
body {
line-height: 1;
}
ol, ul {
list-style: none;
}
blockquote, q {
quotes: none;
}
blockquote:before, blockquote:after,
q:before, q:after {
content: '';
content: none;
}
table {
border-collapse: collapse;
border-spacing: 0;
}
https://necolas.github.io/normalize.css/8.0.1/normalize.css/*! normalize.css v8.0.1 | MIT License | github.com/necolas/normalize.css */
/* Document
========================================================================== */
/**
* 1. Correct the line height in all browsers.
* 2. Prevent adjustments of font size after orientation changes in iOS.
*/
html {
line-height: 1.15; /* 1 */
-webkit-text-size-adjust: 100%; /* 2 */
}
/* Sections
========================================================================== */
/**
* Remove the margin in all browsers.
*/
body {
margin: 0;
}
/**
* Render the `main` element consistently in IE.
*/
main {
display: block;
}
/**
* Correct the font size and margin on `h1` elements within `section` and
* `article` contexts in Chrome, Firefox, and Safari.
*/
h1 {
font-size: 2em;
margin: 0.67em 0;
}
/* Grouping content
========================================================================== */
/**
* 1. Add the correct box sizing in Firefox.
* 2. Show the overflow in Edge and IE.
*/
hr {
box-sizing: content-box; /* 1 */
height: 0; /* 1 */
overflow: visible; /* 2 */
}
/**
* 1. Correct the inheritance and scaling of font size in all browsers.
* 2. Correct the odd `em` font sizing in all browsers.
*/
pre {
font-family: monospace, monospace; /* 1 */
font-size: 1em; /* 2 */
}
/* Text-level semantics
========================================================================== */
/**
* Remove the gray background on active links in IE 10.
*/
a {
background-color: transparent;
}
/**
* 1. Remove the bottom border in Chrome 57-
* 2. Add the correct text decoration in Chrome, Edge, IE, Opera, and Safari.
*/
abbr[title] {
border-bottom: none; /* 1 */
text-decoration: underline; /* 2 */
text-decoration: underline dotted; /* 2 */
}
/**
* Add the correct font weight in Chrome, Edge, and Safari.
*/
b,
strong {
font-weight: bolder;
}
/**
* 1. Correct the inheritance and scaling of font size in all browsers.
* 2. Correct the odd `em` font sizing in all browsers.
*/
code,
kbd,
samp {
font-family: monospace, monospace; /* 1 */
font-size: 1em; /* 2 */
}
/**
* Add the correct font size in all browsers.
*/
small {
font-size: 80%;
}
/**
* Prevent `sub` and `sup` elements from affecting the line height in
* all browsers.
*/
sub,
sup {
font-size: 75%;
line-height: 0;
position: relative;
vertical-align: baseline;
}
sub {
bottom: -0.25em;
}
sup {
top: -0.5em;
}
/* Embedded content
========================================================================== */
/**
* Remove the border on images inside links in IE 10.
*/
img {
border-style: none;
}
/* Forms
========================================================================== */
/**
* 1. Change the font styles in all browsers.
* 2. Remove the margin in Firefox and Safari.
*/
button,
input,
optgroup,
select,
textarea {
font-family: inherit; /* 1 */
font-size: 100%; /* 1 */
line-height: 1.15; /* 1 */
margin: 0; /* 2 */
}
/**
* Show the overflow in IE.
* 1. Show the overflow in Edge.
*/
button,
input { /* 1 */
overflow: visible;
}
/**
* Remove the inheritance of text transform in Edge, Firefox, and IE.
* 1. Remove the inheritance of text transform in Firefox.
*/
button,
select { /* 1 */
text-transform: none;
}
/**
* Correct the inability to style clickable types in iOS and Safari.
*/
button,
[type="button"],
[type="reset"],
[type="submit"] {
-webkit-appearance: button;
}
/**
* Remove the inner border and padding in Firefox.
*/
button::-moz-focus-inner,
[type="button"]::-moz-focus-inner,
[type="reset"]::-moz-focus-inner,
[type="submit"]::-moz-focus-inner {
border-style: none;
padding: 0;
}
/**
* Restore the focus styles unset by the previous rule.
*/
button:-moz-focusring,
[type="button"]:-moz-focusring,
[type="reset"]:-moz-focusring,
[type="submit"]:-moz-focusring {
outline: 1px dotted ButtonText;
}
/**
* Correct the padding in Firefox.
*/
fieldset {
padding: 0.35em 0.75em 0.625em;
}
/**
* 1. Correct the text wrapping in Edge and IE.
* 2. Correct the color inheritance from `fieldset` elements in IE.
* 3. Remove the padding so developers are not caught out when they zero out
* `fieldset` elements in all browsers.
*/
legend {
box-sizing: border-box; /* 1 */
color: inherit; /* 2 */
display: table; /* 1 */
max-width: 100%; /* 1 */
padding: 0; /* 3 */
white-space: normal; /* 1 */
}
/**
* Add the correct vertical alignment in Chrome, Firefox, and Opera.
*/
progress {
vertical-align: baseline;
}
/**
* Remove the default vertical scrollbar in IE 10+.
*/
textarea {
overflow: auto;
}
/**
* 1. Add the correct box sizing in IE 10.
* 2. Remove the padding in IE 10.
*/
[type="checkbox"],
[type="radio"] {
box-sizing: border-box; /* 1 */
padding: 0; /* 2 */
}
/**
* Correct the cursor style of increment and decrement buttons in Chrome.
*/
[type="number"]::-webkit-inner-spin-button,
[type="number"]::-webkit-outer-spin-button {
height: auto;
}
/**
* 1. Correct the odd appearance in Chrome and Safari.
* 2. Correct the outline style in Safari.
*/
[type="search"] {
-webkit-appearance: textfield; /* 1 */
outline-offset: -2px; /* 2 */
}
/**
* Remove the inner padding in Chrome and Safari on macOS.
*/
[type="search"]::-webkit-search-decoration {
-webkit-appearance: none;
}
/**
* 1. Correct the inability to style clickable types in iOS and Safari.
* 2. Change font properties to `inherit` in Safari.
*/
::-webkit-file-upload-button {
-webkit-appearance: button; /* 1 */
font: inherit; /* 2 */
}
/* Interactive
========================================================================== */
/*
* Add the correct display in Edge, IE 10+, and Firefox.
*/
details {
display: block;
}
/*
* Add the correct display in all browsers.
*/
summary {
display: list-item;
}
/* Misc
========================================================================== */
/**
* Add the correct display in IE 10+.
*/
template {
display: none;
}
/**
* Add the correct display in IE 10.
*/
[hidden] {
display: none;
}
这里并没有去除所有样式,因为normalize的作用不同于reset。reset是将所有默认样式去除,而normalize是将所有默认样式统一,这样在不同的浏览器里显示效果也是统一的
box-sizing:用来设置盒子尺寸的计算方式(设置width和height的作用)
内容区的大小outline:用来设置元素的轮廓线,用法和border一样。轮廓和边框不同点的是轮廓不会影响到页面布局 .box1{
width: 200px;
height: 200px;
background-color: #bfa;
/* 轮廓属性 */
outline: 10px solid red;
}

box-shadow:属性用于在一个元素的框架周边添加阴影效果box-shadow:水平偏移量 垂直偏移量 阴影的模糊半径 颜色box-shadow: 10px 10px 5px orange;

border-radius: 属性使一个元素的外边框角变圆。border-radius:用来设置圆角,圆角设置的是圆的半径大小。
border-top-left-radiusborder-top-right-radiusborder-bottom-left-radiusborder-bottom-right-radius border-radius: 10px;

border-radius:可以分别指定四个角的圆角
左上 右上 右下 左下左上 右上/左下 右下左上/右下 右上/左下顺时针 + 对角线原则即可 .box1{
width: 200px;
height: 200px;
background-color: #bfa;
/* 设置圆 */
border-radius: 50%;
}

只需要对圆进行一点点的改动即可,设置width和height属性不相等即可
.box1{
width: 300px;
height: 200px;
background-color: #bfa;
border-radius: 50%;
}

float属性来指定浮动:
设置浮动以后,水平布局的等式便不需要强制成立浮动元素向左或向右移动时,不会超过前边的浮动元素 .box1{
width: 400px;
height: 200px;
background-color: #bfa;
}
.box2{
width: 200px;
height: 300px;
background-color: orange;
float: left;
}

文字环绕图片的效果。
.box1{
background-color: #bfa;
float: left;
}

I am a Span
