html - Float forcing min-width on responsive div elements? -
hello have div following css
{background: purple; max-width: 800px; min-width: 300px; height: 200px; float: left;}
unfortunately being forced min width (if remove float fine).
is floats do, or have made error somewhere?
jsfiddle:
this expected behaviour.
div
block element , takes 100% width (if no css rule applied).
but if float div, modifing original flow, stops behaving block, takes width needed based on content (or as specified min-width/max-width).
so, no, not doing wrong.
edit: if correctly understand trying achieve, happens if add width:100%
div style?
Comments
Post a Comment