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:

http://jsfiddle.net/bhy3h/

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?

http://jsfiddle.net/gptrt/1/


Comments

Popular posts from this blog

css - Which browser returns the correct result for getBoundingClientRect of an SVG element? -

gcc - Calling fftR4() in c from assembly -

Function that returns a formatted array in VBA -