V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
Can I use?
http://caniuse.com/
Less
http://lesscss.org
Cool Libraries
Bootstrap from Twitter
Jetstrap
aoscici2000
V2EX  ›  CSS

如何在 div 内部再实现 fixed 效果

  •  
  •   aoscici2000 · 2019-04-22 15:20:49 +08:00 · 2503 次点击
    这是一个创建于 1821 天前的主题,其中的信息可能已经有所发展或是发生改变。

    假设我要做个弹出的 div, 要 dialog-header 那块相对于 dialog 是固定的, 这一块怎么设置 css?

    <body>
    	<div id="dialog" style="display:fixed">
    		<div id="dialog-header">
    		.....
    		</div>
    		<div id="dialog-content">
    		......
    		</div>
        </div>
    </body>
    
    
    1 条回复    2019-04-22 15:30:38 +08:00
    ToHaveLight
        1
    ToHaveLight  
       2019-04-22 15:30:38 +08:00
    dialog-header 设置成 absolute
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   我们的愿景   ·   实用小工具   ·   1073 人在线   最高记录 6543   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 30ms · UTC 18:56 · PVG 02:56 · LAX 11:56 · JFK 14:56
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.