php中定位,php学习之div+css定位技术之固定定位(一)

说明在浏览器中把某个或某些元素进行位置的定位

position:定位                属性值fixed(固定定位)、relative(相对定位)、absolute(绝对定位)        定位一起使用的还有top、left、right、bottom,具体定位的位置对应的属性,     比如:position:fixed;   top:10px; left:10px;

fixed:固定定位

说明:固定位置的元素是以浏览器窗口来定位的方式,脱离原来文档流,不在占用空间

语法:positionLfixed;

top:  10px;   left:10px;    right:10px;           bottom:10px;

案例:

afa9a00de7cb6d01b956b628a2358213.png

Document

*{

padding:0px;

margin:0px;

}

.box{

width:160px;

position:fixed;

right:3px;

top:25px;

}

.box-left{

width:29px;

height:300px;

float:left;

background:url(./images/zqq02.jpg) no-repeat left 90px;

}

.box-right{

width:130px;

float:right;

}

.b-r-top{

width:130px;

height:11px;

background:url(./images/zqq01.gif) no-repeat left top ;

}

.b-r-center{

width:130px;

background:url(./images/zqq01.gif) repeat-y right top;

text-align:center;

}

.b-r-bottom{

width:130px;

height:11px;

background:url(./images/zqq01.gif) no-repeat center top;

}

.c-b-t{

width:130px;

height:8px;

background:url(./images/zqq06.jpg) no-repeat left bottom;

}

.c-b-b{

width:130px;

height:8px;

background:url(./images/zqq06.jpg) no-repeat left top;

}

zqq03.jpg

zqq04.jpg

zqq05.jpg

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值