korki696 Posted October 4, 2009 Share Posted October 4, 2009 Hey all, I am working on a site right now but I have a problem that I just cant figure out. What i am trying to do is have two echoes that are next to eachother but with different HTML formating. <div class="additional_info ie6fix" id='twitterbox'> <?php echo $feed[0]; ?> <h2><?php echo $feed[1]; ?></h2> <h4><?php echo $feed[2]; ?></h4> </div> So in that example lets say $feed[1] = "Hello " and $feed[2] = "Mom". I want the output to be Hello Mom. The output i currently get is: Hello Mom with the different formatting. How can i get the two outputs on the same line? Thanks Quote Link to comment https://forums.phpfreaks.com/topic/176483-php-html-formatting/ Share on other sites More sharing options...
mikesta707 Posted October 4, 2009 Share Posted October 4, 2009 heading tags automatically go to the next line. if you want to be next to each other you will have to set their float style, or some other display style try <div class="additional_info ie6fix" id='twitterbox'> <?php echo $feed[0]; ?> <h2 style="float:left"><?php echo $feed[1]; ?></h2> <h4 style="float:left"><?php echo $feed[2]; ?></h4> </div> I'm a little rusty on my CSS though, so that might be wrong Quote Link to comment https://forums.phpfreaks.com/topic/176483-php-html-formatting/#findComment-930305 Share on other sites More sharing options...
mrMarcus Posted October 4, 2009 Share Posted October 4, 2009 echo $feed[0].', '.$feed[1]; the . attaches the two variables .. http://us3.php.net/manual/en/language.operators.string.php using html <h> tags though, you will always get a line break as they are used for headers .. headers are standalone unless specified otherwise using CSS. Quote Link to comment https://forums.phpfreaks.com/topic/176483-php-html-formatting/#findComment-930306 Share on other sites More sharing options...
korki696 Posted October 4, 2009 Author Share Posted October 4, 2009 Hey i tried the float setting already and it didnt help. All i need is that the second feed is smaller is there another way to do this? Thanks again Quote Link to comment https://forums.phpfreaks.com/topic/176483-php-html-formatting/#findComment-930308 Share on other sites More sharing options...
mikesta707 Posted October 4, 2009 Share Posted October 4, 2009 you can just set the font size. <div class="additional_info ie6fix" id='twitterbox'> <?php echo $feed[0]; ?> <span style="font-size:large" ><?php echo $feed[1]; ?></span> <span style="font-size:small" ><?php echo $feed[2]; ?></span> </div> Quote Link to comment https://forums.phpfreaks.com/topic/176483-php-html-formatting/#findComment-930310 Share on other sites More sharing options...
korki696 Posted October 4, 2009 Author Share Posted October 4, 2009 The problem im having using span tags is that the alignment is off. it goes on top of a picture that is to the left. Thanks. Quote Link to comment https://forums.phpfreaks.com/topic/176483-php-html-formatting/#findComment-930321 Share on other sites More sharing options...
mrMarcus Posted October 4, 2009 Share Posted October 4, 2009 is this really php formatting or just straight html/css formatting? Quote Link to comment https://forums.phpfreaks.com/topic/176483-php-html-formatting/#findComment-930326 Share on other sites More sharing options...
mikesta707 Posted October 4, 2009 Share Posted October 4, 2009 hmm well to help I'd really have to see more code than what you provided. But this is pretty much an HTML/CSS problem, so you may have better luck if you take this to that forum Quote Link to comment https://forums.phpfreaks.com/topic/176483-php-html-formatting/#findComment-930329 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.