BrandonE97 Posted July 7, 2007 Share Posted July 7, 2007 My text is showing up in the middle of my pages. How can I get it to show up at the top of the page? I've tried a couple things but I'm still a bit new to css. Thanks for any help. Quote Link to comment https://forums.phpfreaks.com/topic/58806-solved-text-not-showing-up-right/ Share on other sites More sharing options...
Philip Posted July 7, 2007 Share Posted July 7, 2007 What is your current code Your padding/margins might be pretty large if the text isn't at the top of the page Quote Link to comment https://forums.phpfreaks.com/topic/58806-solved-text-not-showing-up-right/#findComment-291786 Share on other sites More sharing options...
BrandonE97 Posted July 7, 2007 Author Share Posted July 7, 2007 This is what I've got for each page to use: td#body { text-align:center; width:545px; padding:10px; } Firefox shows it correctly but IE positions it half way down the page. Quote Link to comment https://forums.phpfreaks.com/topic/58806-solved-text-not-showing-up-right/#findComment-291883 Share on other sites More sharing options...
AndyB Posted July 7, 2007 Share Posted July 7, 2007 We'd need to see more than one declaration, i.e. let's see some of the html code. I assume your stuff is in a table. By default, td content is vertically aloigned in the moddle of the cell. Wonder if that's anything to do with it? Quote Link to comment https://forums.phpfreaks.com/topic/58806-solved-text-not-showing-up-right/#findComment-291888 Share on other sites More sharing options...
soycharliente Posted July 7, 2007 Share Posted July 7, 2007 Are you floating anything? FF and IE7 do an excellent job of knowing where to position if you're using 2 columns with float. For some reason, if you don't also float the right side, IE6 will push what's in the right column far enough down so that all the left column data is above it. Â Might not apply, but I've had that happen and it's an easy fix. Quote Link to comment https://forums.phpfreaks.com/topic/58806-solved-text-not-showing-up-right/#findComment-291901 Share on other sites More sharing options...
BrandonE97 Posted July 7, 2007 Author Share Posted July 7, 2007 <body> <table cellpadding="0" cellspacing="0"> <tr> <td valign="top" rowspan="2" width="115"> <?php include("navmenu.php"); ?> </td> <td valign="top" height="75" class="title">IP Info</td> </tr> <tr> <td id="body" valign="top"> Check your IP address here<br /> <span class="spgreen"> <?php echo('IP:Â '.$_SERVER['REMOTE_ADDR']); ?></span><br /> </td> </tr> </table> </body> Quote Link to comment https://forums.phpfreaks.com/topic/58806-solved-text-not-showing-up-right/#findComment-291933 Share on other sites More sharing options...
soycharliente Posted July 7, 2007 Share Posted July 7, 2007 EDIT: Wait. hold on. Quote Link to comment https://forums.phpfreaks.com/topic/58806-solved-text-not-showing-up-right/#findComment-291942 Share on other sites More sharing options...
soycharliente Posted July 7, 2007 Share Posted July 7, 2007 Which text in the table is showing in the middle of the page? Quote Link to comment https://forums.phpfreaks.com/topic/58806-solved-text-not-showing-up-right/#findComment-291944 Share on other sites More sharing options...
BrandonE97 Posted July 7, 2007 Author Share Posted July 7, 2007 everything within the <td id="body>till</td> Quote Link to comment https://forums.phpfreaks.com/topic/58806-solved-text-not-showing-up-right/#findComment-291945 Share on other sites More sharing options...
soycharliente Posted July 7, 2007 Share Posted July 7, 2007 The height of the cell above it is set to 75 pixels. I don't know what class="title" does, but that is pushing the IP address you're getting down farther. Quote Link to comment https://forums.phpfreaks.com/topic/58806-solved-text-not-showing-up-right/#findComment-291946 Share on other sites More sharing options...
BrandonE97 Posted July 7, 2007 Author Share Posted July 7, 2007 td.title { width:545px; height:75px; font-size:46px; text-align:center; text-decoration:underline; font-weight:bold; } Â I removed the height from the html since I should probably keep that in the css doc. As far as what is pushing the text down I have no idea how to fix that. Quote Link to comment https://forums.phpfreaks.com/topic/58806-solved-text-not-showing-up-right/#findComment-291950 Share on other sites More sharing options...
soycharliente Posted July 7, 2007 Share Posted July 7, 2007 Do you have a link to the page so I can look at it? Quote Link to comment https://forums.phpfreaks.com/topic/58806-solved-text-not-showing-up-right/#findComment-291952 Share on other sites More sharing options...
BrandonE97 Posted July 7, 2007 Author Share Posted July 7, 2007 http://www.brandone97.com/IP.BE97 Quote Link to comment https://forums.phpfreaks.com/topic/58806-solved-text-not-showing-up-right/#findComment-291955 Share on other sites More sharing options...
soycharliente Posted July 7, 2007 Share Posted July 7, 2007 The code you posted is not the code that is being used on the page. Are you sure that you uploaded it? Â Example: You posted: <td valign="top" height="75" class="title">IP Info</td> Being used: <td class="title">IP Info</td> Quote Link to comment https://forums.phpfreaks.com/topic/58806-solved-text-not-showing-up-right/#findComment-291965 Share on other sites More sharing options...
calabiyau Posted July 7, 2007 Share Posted July 7, 2007 I don't know much about tables for layout but it seems like you have one tr row that contains the navigation and the header IP INFO, then you create a new tr that contains the actual ip info. Â If you think about it, that first tr is going to expand to the height of the nav on the left since it contains that td, so the next tr will come below that. and it looks like the ip address comes immediately after the height of the nav on the left. Â Maybe try moving the ip information into the td that contains the ip header. Â Again I don't really know tables that well but that's what it seems like to me. Â Quote Link to comment https://forums.phpfreaks.com/topic/58806-solved-text-not-showing-up-right/#findComment-291967 Share on other sites More sharing options...
BrandonE97 Posted July 7, 2007 Author Share Posted July 7, 2007 I'm still trying different things and moving what code I can from html to css. Sorry about that. I'll not mod anything else for right now. Quote Link to comment https://forums.phpfreaks.com/topic/58806-solved-text-not-showing-up-right/#findComment-291969 Share on other sites More sharing options...
soycharliente Posted July 7, 2007 Share Posted July 7, 2007 I don't know much about tables for layout but it seems like you have one tr row that contains the navigation and the header IP INFO, then you create a new tr that contains the actual ip info. If you think about it, that first tr is going to expand to the height of the nav on the left since it contains that td, so the next tr will come below that. and it looks like the ip address comes immediately after the height of the nav on the left. Maybe try moving the ip information into the td that contains the ip header. Again I don't really know tables that well but that's what it seems like to me.  Your assessment is wrong. He's using rowspan on the very first td. From a GENERAL standpoint, the first table has 3 cells. 2 in the first row and 1 in the second. The first cell in the first row (the navigation) uses rowspan='2' so he doesn't need 2 cells in the second row. the first cell is "there" because the first cell in the first row takes up that space. The second cell in teh 2nd row will not start at the bottom of the nav cell. Quote Link to comment https://forums.phpfreaks.com/topic/58806-solved-text-not-showing-up-right/#findComment-291976 Share on other sites More sharing options...
calabiyau Posted July 7, 2007 Share Posted July 7, 2007 Eeep! Sorry, sorry, sorry...just went on a quick look, should've digged a little deeper. sorry for the bad advice. Quote Link to comment https://forums.phpfreaks.com/topic/58806-solved-text-not-showing-up-right/#findComment-292012 Share on other sites More sharing options...
BrandonE97 Posted July 11, 2007 Author Share Posted July 11, 2007 Anytime I use the css code it shows up half way down the screen: td#body { vertical-align:top; text-align:center; width:555px; height:auto; padding:10px; } but when I take away the id="body" and put a width and height in the code it shows up correctly and my content is right under the page title. <body> <table cellpadding="0" cellspacing="0"> <tr> <td valign="top" rowspan="2"> <?php include("navmenu.php"); ?> </td> <td class="title">IP Info</td> </tr> <tr> <td id="body"> Check your IP address here<br /> <span class="spgreen"> <?php echo('IP:Â '.$_SERVER['REMOTE_ADDR']); ?></span> </td> </tr> </table> </body> So any ideas as to what is wrong, I cant figure it out. Thanks for any help and the help of those that have already replied. Quote Link to comment https://forums.phpfreaks.com/topic/58806-solved-text-not-showing-up-right/#findComment-294929 Share on other sites More sharing options...
mainewoods Posted July 11, 2007 Share Posted July 11, 2007 It's surely this line: <td class="title">IP Info</td> --the browser is making that cell tall, it equals "height of left rowspanned td" minus "height of bottom right td" -solution: get rid of rowspan and just make it a 2 col, 1 row table: <table cellpadding="0" cellspacing="0"> Â Â <tr> Â Â Â Â <td valign="top"> Â Â Â Â Â Â <?php include("navmenu.php"); ?> Â Â Â Â </td> Â Â Â Â <td id="body"> Â Â Â Â Â Â IP Info<br /> Â Â Â Â Â Â Check your IP address here<br /> Â Â Â Â Â Â <span class="spgreen"> <?php echo('IP:Â '.$_SERVER['REMOTE_ADDR']); ?></span> Â Â Â Â </td> Â Â </tr> </table> Quote Link to comment https://forums.phpfreaks.com/topic/58806-solved-text-not-showing-up-right/#findComment-294970 Share on other sites More sharing options...
BrandonE97 Posted July 11, 2007 Author Share Posted July 11, 2007 Here is the title css: td#title { width:555px; height:75px; vertical-align:top; font-size:46px; text-align:center; text-decoration:underline; font-weight:bold; } I figured the height would fix my problem. Firefox still renders it correctly lol. Thanks for everyones help. Quote Link to comment https://forums.phpfreaks.com/topic/58806-solved-text-not-showing-up-right/#findComment-295700 Share on other sites More sharing options...
BrandonE97 Posted July 12, 2007 Author Share Posted July 12, 2007 I've found a sort of fix for my problem. I put in the td#body css height:700px; instead of height:auto; so now it doesnt stretch the other td. Thanks again for all the help! Quote Link to comment https://forums.phpfreaks.com/topic/58806-solved-text-not-showing-up-right/#findComment-296074 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.