travelkind Posted June 14, 2010 Share Posted June 14, 2010 Ok guys I hope this doesn't seem like to simple of a question but I need some help getting my footer to left justify. The main page (html below) has a reference to require("footer.php"); which I need to have left justified and not in the middle of my page. What html do I need to put in to make it justify to the left? Thanks for your help! <? session_start(); require("header.php"); ?> <table width="300" border="0" align="left" cellpadding="0" cellspacing="1" bgcolor="#CCCCCC"> <tr> <form name="form1" method="post" action="checklogin.php"> <td> <table width="100%" border="0" cellpadding="3" cellspacing="1" bgcolor="#FFFFFF"> <tr> <td colspan="3"><strong>Member Login </strong></td> </tr> <tr> <td width="78">Username</td> <td width="6">:</td> <td width="294"><input name="myusername" type="text" id="myusername"></td> </tr> <tr> <td>Password</td> <td>:</td> <td><input name="mypassword" type="text" id="mypassword"></td> </tr> <tr> <td> </td> <td> </td> <td><input type="submit" name="Submit" value="Login"></td> </tr> </table> </td> </form> </tr> </table> <?php session_destroy(); require("footer.php"); ?> Quote Link to comment Share on other sites More sharing options...
bugcoder Posted June 14, 2010 Share Posted June 14, 2010 though its a html question but here is the solution use divs for this purpose. wrap code of table in one div and of footer in another div and use style = "float:left" or "style=float:right" in divs to handle alignments Quote Link to comment Share on other sites More sharing options...
travelkind Posted June 14, 2010 Author Share Posted June 14, 2010 bugcoder, I tried this but it I got a syntax error: <?php session_destroy(); <div style="style = "float:left"> require("footer.php"); </div> ?> I guess all html is supposed to be above any php code. Where was I suppose to put the <div ? Thanks! Quote Link to comment Share on other sites More sharing options...
travelkind Posted June 14, 2010 Author Share Posted June 14, 2010 Okay I think you were telling me to make this <div change in the footer.php file? I tried the following code below but it still didn't work: </div> <div id="footer"> <div id="style" = "float:left"> Copyright © 2010 <?php echo $config_administrator; ?> </div> </body> </html> Quote Link to comment Share on other sites More sharing options...
kenrbnsn Posted June 14, 2010 Share Posted June 14, 2010 Learn how to write inline CSS: <div style="float:left">content</div> Ken Quote Link to comment Share on other sites More sharing options...
travelkind Posted June 14, 2010 Author Share Posted June 14, 2010 Okay I tried: <div style="float:left">content</div> but it the word "content" next to my footer in the middle of the page. I tried an alternative: </div> <div id="footer"> <div style="float:left"> Copyright © 2010 <?php echo $config_administrator; ?> </div> </body> </html> This didn't work either. It is still putting my footer in the middle. Any other ideas? Thanks again for your help. Quote Link to comment Share on other sites More sharing options...
kenrbnsn Posted June 14, 2010 Share Posted June 14, 2010 Try <div id="footer" style="float:left"> Copyright © 2010 <?php echo $config_administrator; ?> </div> Ken Quote Link to comment Share on other sites More sharing options...
travelkind Posted June 14, 2010 Author Share Posted June 14, 2010 It didn't work It seems like having the user name and password are set up in a table might be causing some of my problem. I could easily just get rid of the the table and have those input areas just be left justified. Quote Link to comment Share on other sites More sharing options...
hcdarkmage Posted June 14, 2010 Share Posted June 14, 2010 It may help if we can see the code to footer.php. There maybe some CSS styling or inline styling in there that is causing the problem. pLease post more code in the [ code ][ /code ] tags so we can help you out more. Quote Link to comment Share on other sites More sharing options...
travelkind Posted June 14, 2010 Author Share Posted June 14, 2010 Here is the code to footer.php </div> <div id="footer"> <div id="footer" style="float:left"> Copyright © 2010 <?php echo $config_administrator; ?> </div> </body> </html> Quote Link to comment Share on other sites More sharing options...
kenrbnsn Posted June 14, 2010 Share Posted June 14, 2010 What is the CSS for the id "footer"? Do you have a URL where we can see this in action? Ken Quote Link to comment Share on other sites More sharing options...
travelkind Posted June 14, 2010 Author Share Posted June 14, 2010 At this point I am not using CSS so their isn't a CSS file. Here is a link to a test page for this: http://www.fuelpartner.com/mse/lp/main_login.php Quote Link to comment Share on other sites More sharing options...
kenrbnsn Posted June 14, 2010 Share Posted June 14, 2010 Replace <div id="footer"> <div id="footer" style="float:left"> with <div id="footer" style="clear:both;"> Ken Quote Link to comment Share on other sites More sharing options...
hcdarkmage Posted June 14, 2010 Share Posted June 14, 2010 Actually ken, if you go to the link he supplied and look at the page source, you'll see that his whole code is messed up. Travel, could you please show the code you have for all three pages, and make sure you use the code tags for your code. That way we can help you out. There are many inconsistencies that need to be fixed and that may be what is causing your problems. Just post the current code by doing something like: header.php code here main code code here footer.php code here Quote Link to comment Share on other sites More sharing options...
travelkind Posted June 14, 2010 Author Share Posted June 14, 2010 Okay the code ken gave me worked! What exactly does the "clear:both" do that "float:left" wasn't (if it is an easy explanation). Thanks again for your help. Quote Link to comment 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.