UnknownPlayer Posted June 7, 2011 Share Posted June 7, 2011 I have this code: #content { width:900px; height:auto; margin:auto; border:solid 1px #000; background-image:url(../images/img6.jpg); background-repeat:repeat-x; background-color:#FFF; padding: 30px 10px 10px 10px; -moz-border-radius : 10px; -webkit-border-radius : 10px; } .article { width:300px; height:200px; -moz-border-radius : 5px; -webkit-border-radius : 5px; background-color:#CCC; float:left; margin:0 20px 20px 0; position:relative; } <div id="content"> <div class="article"></div> <div class="article"></div> <div class="article"></div> </div> But i got this: This in red is problem, why articles are not in content div ? And why content div is not height auto ? Quote Link to comment https://forums.phpfreaks.com/topic/238703-problem-with-divs/ Share on other sites More sharing options...
fugix Posted June 7, 2011 Share Posted June 7, 2011 can you tell me which divs belong to which boxes? Quote Link to comment https://forums.phpfreaks.com/topic/238703-problem-with-divs/#findComment-1226622 Share on other sites More sharing options...
UnknownPlayer Posted June 7, 2011 Author Share Posted June 7, 2011 This #content is that grey div behind the article divs, but that content need to be height 100%. When i put some other text in that content div, it works fine, but when there is article class it doesnt work.. Can you help ? Quote Link to comment https://forums.phpfreaks.com/topic/238703-problem-with-divs/#findComment-1226653 Share on other sites More sharing options...
fugix Posted June 7, 2011 Share Posted June 7, 2011 in the article class. take out the position relative. Quote Link to comment https://forums.phpfreaks.com/topic/238703-problem-with-divs/#findComment-1226662 Share on other sites More sharing options...
UnknownPlayer Posted June 7, 2011 Author Share Posted June 7, 2011 Still same In attachment is website, chek out and tell me the error, if you can Thanks [attachment deleted by admin] Quote Link to comment https://forums.phpfreaks.com/topic/238703-problem-with-divs/#findComment-1226681 Share on other sites More sharing options...
cssfreakie Posted June 8, 2011 Share Posted June 8, 2011 try this: #content { width:900px; /* we don't set a height */ overflow:hidden; /* but we do set this */ border:solid 1px #000; background-image:url(../images/img6.jpg); background-repeat:repeat-x; background-color:#FFF; padding: 30px 10px 10px 10px; -moz-border-radius : 10px; -webkit-border-radius : 10px; } Quote Link to comment https://forums.phpfreaks.com/topic/238703-problem-with-divs/#findComment-1226765 Share on other sites More sharing options...
UnknownPlayer Posted June 8, 2011 Author Share Posted June 8, 2011 Thanks.. it works now Quote Link to comment https://forums.phpfreaks.com/topic/238703-problem-with-divs/#findComment-1226885 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.