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

mod rewrite - Using "?" when rewriting the URL -

.htaccess: Transfer name to index.php if not directory public -

Admob integration with pygame in android -