源来页 公告 登陆

悬浮position: fixed宽度坍塌解决

composer @Ta
2020-02-14 13:09


	/*这是用来悬浮的*/
	position: fixed;
	/*用于悬浮在2div之上*/
	z-index:1

解决办法就是用一个空的div设置好相应的宽度。
然后给悬浮的div也设置上,然后用
z-index:1
悬浮在空标签之上
本站悬浮css:
.zq_fixed{
	text-align: center;
	padding: 2px 8px 2px 8px;
	margin: 2px 2px;
	width: 15%;
	max-width: 200px;
	background-color: #FFFFFF;
	color: #000000;
	display: inline-block;
	/*这是用来悬浮的*/
	position: fixed;
	/*用于悬浮在2div之上*/
	z-index:1
}

HTML:
<div class="zq_fixed">

<img src="https://zl88.net/upload/2019-08-24_09-51-00.png" style="width:80px; height:80px; border-radius:100%; overflow:hidden;border: 2px solid #DCDCDC;">

天合之作 曲在人意
<hr>
<p style="text-align: left;">
<b>Name:</b>作曲

<b> Age:</b>永远18

<b>Sign:</b>做一只没有梦想的咸鱼

<b>简介:</b>此处为作曲博客,主要分享个人经验,收录资源,免得以后忘了,就不用去百度了<img src="https://zl88.net/img/tb/%E6%BB%91%E7%A8%BD.png"/>。</p>
</div>
<!--不让悬浮宽度坍塌需要有宽度的空标签-->
<div class="zq_centerall2"></div>
阅:1236 发表于2020-02-14 13:09
#其他源码
评论:

返回源来页/返回首页


天合之作 曲在人意

心灵鸡汤:
      

®2019-2024 all power by Zlproject3.7
川公网安备 51192202000151号
蜀ICP备2021014921号-2 首页 #top

本网站由提供CDN加速/云储存服务

天合之作 曲在人意