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