manix Posted June 26, 2011 Share Posted June 26, 2011 How can I have text or other elements aligned at both left and right sides of a SINGLE line. The way I figured is using <pre> and having it all on a single line, but I doubt that's the most common way. Thanks for your time. Quote Link to comment https://forums.phpfreaks.com/topic/240427-text-on-both-sides/ Share on other sites More sharing options...
wildteen88 Posted June 26, 2011 Share Posted June 26, 2011 You don't position the text using PHP. You use html/css for this. Example HTML/CSS code for floats <div class="float-container"> <div class="left">text on the left side</div> <div class="right">text on right side</div> </div> And the CSS .float-container { width: 100%; overflow: auto; } .left { float: left; } .right { float: right; } Quote Link to comment https://forums.phpfreaks.com/topic/240427-text-on-both-sides/#findComment-1234928 Share on other sites More sharing options...
manix Posted June 26, 2011 Author Share Posted June 26, 2011 aww okay but it didn't work right.. i have a few buttons on the left and then on the right another few are displayed lower than the right ones :/ Quote Link to comment https://forums.phpfreaks.com/topic/240427-text-on-both-sides/#findComment-1234933 Share on other sites More sharing options...
cssfreakie Posted June 26, 2011 Share Posted June 26, 2011 Here is a good read about the property float. http://css.maxdesign.com.au/floatutorial/introduction.htm You often use them in combination with the property clear Quote Link to comment https://forums.phpfreaks.com/topic/240427-text-on-both-sides/#findComment-1234987 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.