1. position细说
position:relative; position:absolute;
left:100px left:100px
top:100px top:100px
position:relative;如果说设值了,相对原来的位置进行调整
二者区别——
absolute会脱离标准文档流,relative不会,relative虽然给值了,但是依然占有着原来的位置;
relative存在“形影分离”,所以一般情况下不建议添加值,一般给子元素当参照物,或者元素的微调;
absolute会有一种现象“压盖”效果;
*z-index层次关系,可以改变元素的层叠位置,所以的标签默认是0,z-index值越大,该元素就在上方
*以后我们做定位的时候尽量保持“子绝父相”
2. fixed 固定定位
position:fixed;
. head {
position:fixed;
top:0;
bottom:0;
background:red;
height:60px;
width:100px;
}
使文档脱离标准文档流属性:
float position:absolu; position:relative; position:fixe;
3. form 表单
< form action= " " method= " " >
< input type= " submit " value=" " />
< / from >
action 提交的地址:https://www.baidu.com
method 提交方式:
post :加密在http中的一个body对象上提交的
get:是在http的url上提交不加密
4. 类型
< input type= " text " / > 文本框标签
< input type= " password " / > 密码框
< input type= " radio " / > 单选框
< input type= " checkbox " / > 多选框
< input type= " buttom " / > 普通按钮
< input type= " submit " value=" 提交 " /> 提交按钮
* http是一种协议,就是客户端跟服务端链接的一种协议( 超文本传输协议 )
5. 下拉列表 select
< select name= " city " >
< option value= " 北京 " >北京< / option >
< option value= " 上海 " >上海< / option >
< / select >
6. 定位让元素居中:
div {
width : 200px;
height : 300px;
background : red;
position :absolute;
left : 50%;
top : 50%;
margin-left : -100px;
margin-top : -150px;
}
7. 透明度 opacity
默认值是 1不透明 0全透明