Home > Web Front-end > HTML Tutorial > fixed 宽度问题_html/css_WEB-ITnose

fixed 宽度问题_html/css_WEB-ITnose

WBOY
Release: 2016-06-24 11:32:59
Original
1150 people have browsed it

当没有设置fixed时,原来的div是自适应上级的宽度(我没有设置具体的宽度的),可设置为fixed是变成屏幕宽度了,我想要的是设置fixed时,如何适应上级的?不行的话,我只能去设置宽度了。。


回复讨论(解决方案)

设置宽度

设置 fixed的元素会脱离文档流独立工作,此时这个元素是相对于整个页面的,宽度自然也就是页面的宽度,所以你需要重新计算你的div宽度达到你想要的。

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template