Jump to content

I need to get rid of carriage returns.


simpson_121919

Recommended Posts

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.

Link to comment
https://forums.phpfreaks.com/topic/285261-i-need-to-get-rid-of-carriage-returns/
Share on other sites

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>

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>

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.