html页面,在浏览器中忽然显现右边空白一块,怎么回事?
<div style="color: black; text-align: left; margin-bottom: 10px;"><span style="color: black;">
<p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;">蟹邀~</p>
<p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;">世界上没有<span style="color: black;">没</span>缘<span style="color: black;">没</span>故的爱</p>
<p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;"><span style="color: black;">亦</span>没有<span style="color: black;">没</span>缘<span style="color: black;">没</span>故的恨</p>
<p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;"><span style="color: black;">亦</span>并没有<span style="color: black;">没</span>缘<span style="color: black;">没</span>故的空白块</p>
<p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;"><span style="color: black;">显现</span>这个问题的<span style="color: black;">原由</span>是:内部元素宽度撑开了页面</p>
<p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;">排除的办法:<span style="color: black;">能够</span>依次删除页面元素,看删掉哪个元素的时候横向滚动条消失了,就说明溢出的元素在其内部。</p>
<div style="color: black; text-align: left; margin-bottom: 10px;"><img src="https://picx.zhimg.com/80/e2a85347b2180ba2a7a10f0cfb05e764_720w.webp?source=1def8aca" style="width: 50%; margin-bottom: 20px;"></div>
<p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;">(在F12<span style="color: black;"><a style="color: black;"><span style="color: black;">掌控</span>台</a></span>选中可疑元素,按下del删除)</p>
<div style="color: black; text-align: left; margin-bottom: 10px;"><span style="color: black;">html</span><span style="color: black;">{</span>
<span style="color: black;">width</span><span style="color: black;">:</span><span style="color: black;">100</span><span style="color: black;">%</span><span style="color: black;">;</span>
<span style="color: black;">overflow-x</span><span style="color: black;">:</span><span style="color: black;">hidden</span><span style="color: black;">;</span>
<span style="color: black;">}</span>
</div>
<p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;">这个<span style="color: black;">办法</span>治标不治本,还是应该找到<span style="color: black;">到底</span>是哪个元素溢出了。</p>
<p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;"><span style="color: black;">例如</span>一个有margin的元素,宽度设置了100%,<span style="color: black;">那样</span>总宽度肯定超过100%,就会<span style="color: black;">引起</span>溢出。</p>
</span></div>
软文发布平台 http://www.fok120.com/ 论坛的成果是显著的,但我们不能因为成绩而沾沾自喜。 你的言辞如同繁星闪烁,点亮了我心中的夜空。
页:
[1]