html - Does adding a position: absolute to a block element make it behave like an inline? -


please refer - https://jsfiddle.net/6nyh5p40/

position: absolute; 

on div making behave inline element. remove property , see div behaves should, block element.

my question - adding position: absolute block element make behave inline?

yes, block element feature of having full width of parent's content area not honored when element absolutely positioned.

if want retain width (100% of container) of block element, add postion: relative; parent of absolute element, set width of absolute element 100%.


Comments

Popular posts from this blog

javascript - Using jquery append to add option values into a select element not working -

Android soft keyboard reverts to default keyboard on orientation change -

jquery - javascript onscroll fade same class but with different div -