html - CSS display:block and position:fixed -


why code:

div {     background-color: yellow;     display:block;     position:fixed; } 

not display div display:block (i.e. flow across page) when add position:fixed? seems work otherwise?

n.b. new css appologise if silly error

when use position: fixed; or position: absolute;, element taken out of regular flow of document.

the default setting width div element auto, means use full available width is. when take out of flow, there no longer usable measure available width (because infinite), instead element width content.


Comments

Popular posts from this blog

SPSS keyboard combination alters encoding -

Add new record to the table by click on the button in Microsoft Access -

javascript - jQuery .height() return 0 when visible but non-0 when hidden -