poison6feet Posted September 3, 2009 Share Posted September 3, 2009 Hi I have wrote CSS and I am using div on my index page, the data and url is picked from database dynamically and displayed on the page. When I am using div it is create some empty space between, I have attached the screen shot. Please help me. [attachment deleted by admin] Link to comment https://forums.phpfreaks.com/topic/172988-div-creating-empty-spaces/ Share on other sites More sharing options...
rhodesa Posted September 3, 2009 Share Posted September 3, 2009 there are a hundred different things that can cause that...can you past a direct link to the page? or at least the HTML code from it? Link to comment https://forums.phpfreaks.com/topic/172988-div-creating-empty-spaces/#findComment-911725 Share on other sites More sharing options...
poison6feet Posted September 3, 2009 Author Share Posted September 3, 2009 http://www.imitigence.com/mga/services.php?id=4 Link to comment https://forums.phpfreaks.com/topic/172988-div-creating-empty-spaces/#findComment-911731 Share on other sites More sharing options...
rhodesa Posted September 3, 2009 Share Posted September 3, 2009 it's because you are floating your DIVs...the first two divs "Audit & Assurane Services" and "Tax" are on the first line, then the next div wont fit, so it's moved to a new line...below the first two divs Link to comment https://forums.phpfreaks.com/topic/172988-div-creating-empty-spaces/#findComment-911745 Share on other sites More sharing options...
poison6feet Posted September 3, 2009 Author Share Posted September 3, 2009 Please find my exact code, please suggest me the solution. CSS #content { color: #000000; height: AUTO; width: 600px; float:left; margin-top: 0px; filter: alpha(opacity=80);-moz-opacity: 0.8; } #dispcategorieslp { margin: 5px 0 0 0; background-color: white; padding: 10px; width: 270px; font-size: 14px; font-family: Arial; text-align: left; filter: alpha(opacity=80);-moz-opacity: 0.8; color:#0066FF; float:left; } PHP <div id="content"> while($row_list=mysql_fetch_assoc($result)){ ?> <div id="dispcategories"> <strong><a href=<?echo $row_list['url'];?> style='text-decoration: none;'><?echo $row_list['Name'];?></a></strong> <? $subquery="select menusubcatid, catid, name, url, content from menusubcategories where catid=".$row_list['menucatid']; //echo $subquery; $subresult=mysql_query($subquery); while($row_list_sub=mysql_fetch_assoc($subresult)){?> <div id="navlist"><a href=<?echo $row_list_sub['url'];?>><?echo $row_list_sub['name'];?></a></div> <? } ?> </div> <? } } ?> </div> Link to comment https://forums.phpfreaks.com/topic/172988-div-creating-empty-spaces/#findComment-911762 Share on other sites More sharing options...
rhodesa Posted September 3, 2009 Share Posted September 3, 2009 if you want a double column like that, there really is no "better" solution Link to comment https://forums.phpfreaks.com/topic/172988-div-creating-empty-spaces/#findComment-911764 Share on other sites More sharing options...
poison6feet Posted September 3, 2009 Author Share Posted September 3, 2009 Thanks rhodesa Link to comment https://forums.phpfreaks.com/topic/172988-div-creating-empty-spaces/#findComment-911774 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.