aoscici2000
V2EX  ›  CSS

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

  •  
  •   aoscici2000 · Apr 22, 2019 · 3258 views
    This topic created in 2618 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   ·   5059 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 33ms · UTC 04:00 · PVG 12:00 · LAX 21:00 · JFK 00:00
    ♥ Do have faith in what you're doing.