div comes vertical when i need it horizontal sideby side as columns

Reply

Join Date: Apr 2005
Posts: 183
Reputation: hbmarar is an unknown quantity at this point 
Solved Threads: 0
hbmarar's Avatar
hbmarar hbmarar is offline Offline
Junior Poster

div comes vertical when i need it horizontal sideby side as columns

 
0
  #1
Oct 20th, 2005
hi,

I am not a expert programmer but would like to play with this.I am findin git strange with the alignment.

I have the following in my code:-

<div id="leftnav"> <?php //some function?> </div>
</td>
<td>
<div id="content"><?php ?></div>



<div id="footer">
</div>


in css file i am having
#leftnav
{
margin-right: 78%!important;
margin-right: 76%;
margin-left: 10px;
margin-top: 0px;
padding: 0;
width: auto!important;
width: 100%;

background-repeat: repeat-y;
background-position: right top;
}
#content {
width: 72%;
float: none;
margin-top: 10px;
padding-right: 10%;
padding-bottom: 1%;
padding-left: 28%;
}

I am also attaching the screen shotpicture for providing a better picture.Hope you might beable to help me.

Thanking you for the concern and consideration

Harish
Attached Thumbnails
divgap.GIF  
Reply With Quote Quick reply to this message  
Join Date: Dec 2004
Posts: 1,655
Reputation: tgreer is an unknown quantity at this point 
Solved Threads: 35
Team Colleague
tgreer tgreer is offline Offline
Made Her Cry

Re: div comes vertical when i need it horizontal sideby side as columns

 
0
  #2
Oct 20th, 2005
I notice some table cell tags in there, orphaned: no table row, or table for that matter. You aren't showing us all the relevant code, and that makes it nearly impossible to help you.
Reply With Quote Quick reply to this message  
Join Date: Apr 2005
Posts: 183
Reputation: hbmarar is an unknown quantity at this point 
Solved Threads: 0
hbmarar's Avatar
hbmarar hbmarar is offline Offline
Junior Poster

Re: div comes vertical when i need it horizontal sideby side as columns

 
0
  #3
Oct 21st, 2005
hi,

thanks for the reply. It would be very kind of you if you could help me out of this problem.

I am pasting the code here.

HTML and CSS Syntax (Toggle Plain Text)
  1. <?php echo "<?xml version=\"1.0\"?> "; ?>
  2. <?php
  3. defined( '_VALID_MOS' ) or die( 'Direct Access to this location is not allowed.' );
  4. ?>
  5. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  6. <html>
  7. <head>
  8.  
  9. <?php mosShowHead(); ?>
  10.  
  11. <?php if ( $my-> id ) initEditor(); ?>
  12.  
  13. <meta http-equiv="Content-Type" content="text/html; <?php echo _ISO; ?>" />
  14. <link href="<?php echo $mosConfig_live_site;?> /templates/alow/css/template_css1.css" rel="stylesheet" type="text/css"/>
  15.  
  16. <!--[if IE 6]> <style type="text/css" title="Site default">
  17. #leftnav {position:relative}</style> <![endif]-->
  18. </head>
  19.  
  20. <body>
  21. <center>
  22. <div id="wrapper">
  23. <div id="main">
  24.  
  25. <div id="top" align="right"> <?php mosLoadModules ( 'user3' ); ?> </div>
  26.  
  27. <div id="header">
  28. <table border="0" width="760" cellpadding="0" cellspacing="0">
  29. <tr>
  30. <td>
  31. <div id="logo1">
  32. <img src="<?php echo $mosConfig_live_site;?>/templates/alow/images/logo2.gif" alt="" >
  33. </div>
  34. </td>
  35.  
  36. <td valign="top">
  37. <table border="0" cellpadding="0" cellspacing="0" width="100%">
  38. <tr height="0"><th colspan="2" ></th></tr>
  39. <tr><td height="15"></td></tr>
  40. <tr>
  41. <td id="sectd" style="padding-left:10"> <p> <?php mosLoadModules ('user3',-2) ; ?></p></td>
  42. <td><img src="<?php echo $mosConfig_live_site;?> /templates/galow/images/ic-cart.gif" alt="" width="45" height="24" border="0"></td>
  43. </tr>
  44. <tr> <td height="4"> </td> </tr>
  45. <td align="top" colspan="2" style="padding-top:0.5">
  46. <img src="<?php echo $mosConfig_live_site;?>/templates/galow/images/hd-cart.jpg" alt="" width="538" height="127" border="0">
  47. </td>
  48. </tr>
  49. <?php if (mosCountModules('user5')>0) { ?>
  50. <tr><td style="padding-left:10">
  51. <?php mosLoadModules ( "user5"); ?>
  52. </td></tr>
  53. <?php } ?>
  54. </table>
  55. </td>
  56. </tr>
  57. </table>
  58. </div>
  59.  
  60. <div id="content"><?php include_once ("mainbody.php"); ?></div>
  61. <!-- end content -->
  62.  
  63. <div id="leftnav"><?php echo mosLoadSecImage(); ?>
  64. <?php echo mosLoadCatImage(); ?>
  65. <?php echo mosLoadItemImage(); ?> </div>
  66. <div class="clear"></div>
  67. <!-- end navigation -->
  68.  
  69. </div><!-- end main -->
  70. </div><!-- end wrapper -->
  71. <div id="footer">
  72. <td valign="left"><?php mosLoadModules ('user3',-2) ; ?> </td></div>
  73. </tr>
  74.  
  75. </table>
  76. </tr>
  77.  
  78. </table>
  79. <br />
  80. <div id="footerred" align="right">
  81. <img src="<?php echo $mosConfig_live_site;?> /templates/alow/images/ft-call-email.gif" alt="" width="256" height="25" border="0">
  82. </div>
  83. </center>
  84. </body>
  85. </html>
Last edited by tgreer; Oct 21st, 2005 at 10:57 am. Reason: Placing code in code tags.
Attached Thumbnails
content.GIF  
Reply With Quote Quick reply to this message  
Join Date: Dec 2004
Posts: 1,655
Reputation: tgreer is an unknown quantity at this point 
Solved Threads: 35
Team Colleague
tgreer tgreer is offline Offline
Made Her Cry

Re: div comes vertical when i need it horizontal sideby side as columns

 
0
  #4
Oct 21st, 2005
I see that you're mixing divs and tables... usually one or the other is used for layout, but not both. The "center" tag is deprecated. Also, your leftname style has width set to 100% and also "auto". I doubt anything could be "side-by-side" with a 100% width block-level element.
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:



Similar Threads
Other Threads in the HTML and CSS Forum
Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC