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
Post a Comment