V2EX = way to explore
V2EX 是一个关于分享和探索的地方
Sign Up Now
For Existing Member  Sign In
aoscici2000
V2EX  ›  CSS

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

  •  
  •   aoscici2000 · Apr 22, 2019 · 3154 views
    This topic created in 2572 days ago, the information mentioned may be changed or developed.

    假设我要做个弹出的 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 replies    2019-04-22 15:30:38 +08:00
    ToHaveLight
        1
    ToHaveLight  
       Apr 22, 2019
    dialog-header 设置成 absolute
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   5755 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 53ms · UTC 08:38 · PVG 16:38 · LAX 01:38 · JFK 04:38
    ♥ Do have faith in what you're doing.