Xyphon Posted July 22, 2009 Share Posted July 22, 2009 Okay, well, I created a div with a specified width, and when I use it it all works fine. BUT, if the text is too big for the DIV, instead of stretching normally, it does something like this(note I put arrows and notes to point it out for you): http://i25.tinypic.com/35mmyq9.png Here's the code for the DIV .table_replaceb2 { border: 1px solid black; float:left; width:115px; } Link to comment https://forums.phpfreaks.com/topic/166909-solved-div-not-stretching-properly/ Share on other sites More sharing options...
haku Posted July 22, 2009 Share Posted July 22, 2009 CSS without HTML is like icing with no cake. Link to comment https://forums.phpfreaks.com/topic/166909-solved-div-not-stretching-properly/#findComment-880043 Share on other sites More sharing options...
Xyphon Posted July 22, 2009 Author Share Posted July 22, 2009 I have the html... If I didn't, I wouldnt be able to tell it didnt work. Do you want to see the html? There's PHP in it too: echo " <div class='table_replace'> <div class='table_replaceb'>" . $Battle_Rows['Enemy_Name'] . " Level: " . $Battle_Rows['Enemy_Level'] . "<br /> HP: " . $Battle_Rows['Enemy_HP'] . "/" . $Battle_Rows['Enemy_Max_HP'] . " Chakra: " . $Battle_Rows['Enemy_Chakra'] . "/" . $Battle_Rows['Enemy_Max_Chakra'] . "</div><br /><br /><br /><br /> <div class='table_replaceb2'>Taijutsu:<br /><a href='battle.php?Type=Taijutsu'>" . $Battle_Rows2['Taijutsu'] . "</a><br /></div><div class='table_replaceb2'>Ninjutsu:<br /><a href='battle.php?Type=Ninjutsu'>" . $Battle_Rows2['Ninjutsu'] . "ffffffffffffffff</a><br /></div><div class='table_replaceb2'><font size='3'>Genjutsu:<br /><a href='battle.php?Type=Genjutsu'>" . $Battle_Rows2['Genjutsu']. "</a><br /></div><div class='table_replace'>Weapon:<br /><a href='battle.php?Type=Weapon'>" . $Battle_Rows2['Weapon'] . "</a><br /></div><br /><div class='table_replaceb'> " . $Battle_Rows2['Username'] . " Level: " . $Battle_Rows2['Level'] . "<br /> HP: " . $Battle_Rows2['HP'] . "/" . $Battle_Rows2['Max_HP'] . " Chakra: " . $Battle_Rows2['Chakra'] . "/" . $Battle_Rows2['Max_Chakra'] . "</div></div>"; Link to comment https://forums.phpfreaks.com/topic/166909-solved-div-not-stretching-properly/#findComment-880048 Share on other sites More sharing options...
haku Posted July 22, 2009 Share Posted July 22, 2009 That's php and HTML mate. Just HTML please. Link to comment https://forums.phpfreaks.com/topic/166909-solved-div-not-stretching-properly/#findComment-880051 Share on other sites More sharing options...
Xyphon Posted July 22, 2009 Author Share Posted July 22, 2009 <div class='table_replace'> <div class='table_replaceb'> Level: <br /> HP: Chakra: </div><br /><br /><br /><br /> <div class='table_replaceb2'>Taijutsu:<br /><a href='battle.php?Type=Taijutsu'></a><br /></div><div class='table_replaceb2'>Ninjutsu:<br /><a href='battle.php?Type=Ninjutsu'>ffffffffffffffff</a><br /></div><div class='table_replaceb2'><font size='3'>Genjutsu:<br /><a href='battle.php?Type=Genjutsu'></a><br /></div><div class='table_replace'>Weapon:<br /><a href='battle.php?Type=Weapon'></a><br /></div><br /><div class='table_replaceb'> Level: <br /> Chakra: </div></div> Link to comment https://forums.phpfreaks.com/topic/166909-solved-div-not-stretching-properly/#findComment-880058 Share on other sites More sharing options...
haku Posted July 22, 2009 Share Posted July 22, 2009 That HTML isn't the same as the HTML for the page you are showing us in the image - there is no word 'punch' anywhere in it for example. Link to comment https://forums.phpfreaks.com/topic/166909-solved-div-not-stretching-properly/#findComment-880064 Share on other sites More sharing options...
Xyphon Posted July 22, 2009 Author Share Posted July 22, 2009 Because Punch is drawn from the database, and you told me to remove the PHP. Link to comment https://forums.phpfreaks.com/topic/166909-solved-div-not-stretching-properly/#findComment-880077 Share on other sites More sharing options...
haku Posted July 22, 2009 Share Posted July 22, 2009 I didn't say remove the php, I said just give HTML. It's hard to debug something when it's not all there. Link to comment https://forums.phpfreaks.com/topic/166909-solved-div-not-stretching-properly/#findComment-880086 Share on other sites More sharing options...
Xyphon Posted July 22, 2009 Author Share Posted July 22, 2009 OK.. <div class='table_replace'> <div class='table_replaceb'>Xyphon Level: 9<br /> HP: 148/148 Chakra: 18/18</div><br /><br /><br /><br /> <div class='table_replaceb2'>Taijutsu:<br /><a href='battle.php?Type=Taijutsu'>Punch</a><br /></div><div class='table_replaceb2'>Ninjutsu:<br /><a href='battle.php?Type=Ninjutsu'>Fire Ball Jutsuffffffffffffffff</a><br /></div><div class='table_replaceb2'><font size='3'>Genjutsu:<br /><a href='battle.php?Type=Genjutsu'>Substitute</a><br /></div><div class='table_replace'>Weapon:<br /><a href='battle.php?Type=Weapon'>Kunai</a><br /></div><br /><div class='table_replaceb'> Xyphon Level: 9<br /> HP: 83/148 Chakra: 18/18</div></div> Link to comment https://forums.phpfreaks.com/topic/166909-solved-div-not-stretching-properly/#findComment-880094 Share on other sites More sharing options...
haku Posted July 22, 2009 Share Posted July 22, 2009 add: overflow:auto; to div.table_replace Link to comment https://forums.phpfreaks.com/topic/166909-solved-div-not-stretching-properly/#findComment-880126 Share on other sites More sharing options...
Xyphon Posted July 22, 2009 Author Share Posted July 22, 2009 Made no difference. Link to comment https://forums.phpfreaks.com/topic/166909-solved-div-not-stretching-properly/#findComment-880132 Share on other sites More sharing options...
haku Posted July 22, 2009 Share Posted July 22, 2009 Gonna need a link then, because it worked when I ran it on my local installation. Link to comment https://forums.phpfreaks.com/topic/166909-solved-div-not-stretching-properly/#findComment-880151 Share on other sites More sharing options...
Xyphon Posted July 22, 2009 Author Share Posted July 22, 2009 Actually, it didn't seem to work because of a cache problem which sometimes makes things update slow for me. It works fine, thanks a lot! Link to comment https://forums.phpfreaks.com/topic/166909-solved-div-not-stretching-properly/#findComment-880747 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.