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
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>
Link to comment
Share on other sites

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>
Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.