944,043 Members | Top Members by Rank

Ad:
Oct 20th, 2005
0

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

Expand Post »
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
Click image for larger version

Name:	divgap.GIF
Views:	36
Size:	7.0 KB
ID:	1463  
Similar Threads
Reputation Points: 10
Solved Threads: 0
Junior Poster
hbmarar is offline Offline
187 posts
since Apr 2005
Oct 20th, 2005
0

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

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.
Team Colleague
Reputation Points: 227
Solved Threads: 37
Made Her Cry
tgreer is offline Offline
1,697 posts
since Dec 2004
Oct 21st, 2005
0

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

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>
Attached Thumbnails
Click image for larger version

Name:	content.GIF
Views:	356
Size:	3.0 KB
ID:	1466  
Last edited by tgreer; Oct 21st, 2005 at 10:57 am. Reason: Placing code in code tags.
Reputation Points: 10
Solved Threads: 0
Junior Poster
hbmarar is offline Offline
187 posts
since Apr 2005
Oct 21st, 2005
0

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

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.
Team Colleague
Reputation Points: 227
Solved Threads: 37
Made Her Cry
tgreer is offline Offline
1,697 posts
since Dec 2004

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in HTML and CSS Forum Timeline: css_menu_clickable_notclickable_setting
Next Thread in HTML and CSS Forum Timeline: How to set up include file for navbar





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC