arunpatal Posted November 16, 2012 Share Posted November 16, 2012 Hi, I am trying to echo $details1 inside the div but it show like this.... For example: Hello, how are you today...... What are you doing today????? but if div width is smaller then text line then i want text to go under it automatically... For example like this: Hello, how are you today... what are you doing today????? <?php if($details1) { echo "<div id='detaildisplay_box' style='overflow: auto;'><code><xmp>$details1</xmp></code></div>"; } else { echo "No detail"; } ?> Link to comment https://forums.phpfreaks.com/topic/270777-div-problem/ Share on other sites More sharing options...
Beeeeney Posted November 16, 2012 Share Posted November 16, 2012 Just use an if.. else statement and use two variables. One for the single line of text and one for the text with the line breaks. Then if div size is whatever, then echo $variable1, else echo $variable2. Link to comment https://forums.phpfreaks.com/topic/270777-div-problem/#findComment-1392878 Share on other sites More sharing options...
arunpatal Posted November 16, 2012 Author Share Posted November 16, 2012 Just use an if.. else statement and use two variables. One for the single line of text and one for the text with the line breaks. Then if div size is whatever, then echo $variable1, else echo $variable2. OK i go it............ Thanks Link to comment https://forums.phpfreaks.com/topic/270777-div-problem/#findComment-1392879 Share on other sites More sharing options...
Manixat Posted November 16, 2012 Share Posted November 16, 2012 remove this style='overflow: auto;' and specify a width Link to comment https://forums.phpfreaks.com/topic/270777-div-problem/#findComment-1392880 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.