css - child div floating underneath its parent -
so basically, want 2 divs sit inside div. first 1 sitting inside no issues, second 1 floats underneath parent. when add overflow:hidden
can't see div anymore. closest i've gotten solution add overflow:auto
, creates scroll bar. have tried resizing, different positioning, overflow , clearfix far can't find solution. ideas guys? jsfiddle demo here http://jsfiddle.net/qlbgc/ help, it's been annoying me couple of days now.
if you're looking have 2 divs side side here's fiddle that.
http://jsfiddle.net/hastig/qlbgc/6/
i stripped out bunch of stuff wasn't sure needed or stuff throwing @ try , affect change.
somebody mentioned missing float: left;
in assume wanted left div.
remember compensate margin , padding match container div.
in example main container 500px wide. if set each float div 250px width when added 20px combined margins on divs total width goes 520px , pushes right div under left div you'll want each floated div @ 240px compensate. same deal percentages.
if misundestood intention , you're looking hide 1 of div use display: none;
on , double width of 1 want show.
Comments
Post a Comment