simpson_121919 Posted January 10, 2014 Share Posted January 10, 2014 I have a alphabet link list that is inline, this list consists of all the 26 letters of the alphabet. I don't want spaces in between each character. The problem is that when I use carriage returns in my code(so that it is readable and not one long line) I get spaces in between the letters in my alphabet link list. Not sure how to fix this, any help would awesome, thanks. Quote Link to comment https://forums.phpfreaks.com/topic/285261-i-need-to-get-rid-of-carriage-returns/ Share on other sites More sharing options...
mac_gyver Posted January 10, 2014 Share Posted January 10, 2014 if you post your code that is producing the output, someone could help you with what it is doing. Quote Link to comment https://forums.phpfreaks.com/topic/285261-i-need-to-get-rid-of-carriage-returns/#findComment-1464717 Share on other sites More sharing options...
cyberRobot Posted January 13, 2014 Share Posted January 13, 2014 Instead of using carriage returns, did you try the break tag (<br>)? <div><a href="#a">A</a><br /><a href="#b">B</a></div> Or better yet, you could use a unordered list and use CSS to remove the bullets. <style type="text/css"> .letterLinks { list-style:none; margin:0; padding:0; } </style> <ul class="letterLinks"> <li><a href="#a">A</a></li> <li><a href="#b">B</a></li> </ul> Quote Link to comment https://forums.phpfreaks.com/topic/285261-i-need-to-get-rid-of-carriage-returns/#findComment-1465059 Share on other sites More sharing options...
kicken Posted January 13, 2014 Share Posted January 13, 2014 I think he's already using a list, but has the li's set to display-inline so they show on a single line rather than a vertical list. The new lines in the source are causing undesired spaces though. One way to fix that is just change where your new lines are so they appear within a tag. Eg: <ul> <li>A</li ><li>B</li ><li>C</li ></ul> Quote Link to comment https://forums.phpfreaks.com/topic/285261-i-need-to-get-rid-of-carriage-returns/#findComment-1465089 Share on other sites More sharing options...
Strider64 Posted January 14, 2014 Share Posted January 14, 2014 li { display: inline-block; list-style: none; width: auto; float: left; } Also works with straight inline li { display: inline; list-style: none; width: auto; float: left; } Quote Link to comment https://forums.phpfreaks.com/topic/285261-i-need-to-get-rid-of-carriage-returns/#findComment-1465164 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.