Solved

Bulleted list: (setting font size or decreasing space b/w bullet and text)

Posted on 2003-11-10
5
2,747 Views
Last Modified: 2013-12-03
Hello,

I would like to know if there is a way to decrease the space between the bullet and the text in a bulleted list. For example take "o" as a bullet in an <LI> as follows:

o   Item 1;
o   Item 2;

What usually happens in the list is that there is a space between the bullet and the text and I would like for this space to go away so as to have almost no space between the two:

o Item 3;

The reason I need this is for a navigation menu.  I have a navigation menu that expands and provides a list of sub-menus. Now, for the sub-menu, sometimes the text flows into the second line.  I would like for the text to align as follows:

o Item4: is way
   too long;

and NOT as follows:
o Item4: is way
too long;

At the same time I would like to not have any space between the text and the bullet.  I can do each one separately, as in, I can get the text to wrap/indent as well as using a "&bull;" character instead of the <li> to control the spacing between the bullet and the text, but I cannot get both together. I would appreciate anybody's help in this matter!! I have tried many different things for a while now and have lots of information to add. I hope I explained myself enough for now!

Thank you,
0
Comment
Question by:mnahas
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
  • 2
5 Comments
 
LVL 3

Accepted Solution

by:
superslamwich earned 50 total points
ID: 9719872
You can use style and tables to get that effect:

<style type='text/css'>
td.bullet  {
  vertical-align:top;
}
</style>
<table border="0" cellpadding="0" cellspacing="0" width="100">
  <tr>
    <td class="bullet">&bull;</td>
    <td>EXAMPLE 1</td>
  </tr>
  <tr>
    <td class="bullet">&bull;</td>
    <td>EXAMPLE 2</td>
  </tr>
  <tr>
    <td class="bullet">&bull;</td>
    <td>EXAMPLE 3</td>
  </tr>
  <tr>
    <td class="bullet">&bull;</td>
    <td>EXAMPLE 4 is WAAAAAAAAY TOO LONG</td>
  </tr>
</table>

{Slam}
0
 
LVL 3

Expert Comment

by:superslamwich
ID: 9719883
You can change the distance from the bullet with the width of the cells and table:

<style type='text/css'>
td.bullet  {
  vertical-align:top;
}
</style>
<table border="0" cellpadding="0" cellspacing="0" width="150">
  <tr>
    <td class="bullet" width="50">&bull;</td>
    <td>EXAMPLE 1</td>
  </tr>
  <tr>
    <td class="bullet">&bull;</td>
    <td>EXAMPLE 2</td>
  </tr>
  <tr>
    <td class="bullet">&bull;</td>
    <td>EXAMPLE 3</td>
  </tr>
  <tr>
    <td class="bullet">&bull;</td>
    <td>EXAMPLE 4 is WAAAAAAAAY TOO LONG</td>
  </tr>
</table>

{Slam}
0
 
LVL 31

Expert Comment

by:seanpowell
ID: 9722232
You can use some CSS to achieve this. Try customizing the different selectors to fit your layout.

<html>
<head>
<style type="text/css">
<!--
body       { font:normal 11px Verdana, Arial, Helvetica, sans-serif; color:#000; }
.container { padding:0px; width:122px; }
.bullet    { height:30px; }
.list      { padding-left:4px; height:30px; }          
//-->
</style>
</head>
<body>
<div class="container"><span class="bullet">&bull;</span><span class="list">Item 1</span></div>
<div class="container"><span class="bullet">&bull;</span><span class="list">Item 2</span></div>
<div class="container"><span class="bullet">&bull;</span><span class="list">Item 3</span></div>
<div class="container"><span class="bullet">&bull;</span><span class="list">Item 1 is way too long</span></div>
</div>
</body>
</html>

You can also do this with an image as the bullet:
Note: The image being referenced is from this site...


<html>
<head>
<style type="text/css">
<!--
body       {
           font:normal 11px Verdana, Arial, Helvetica, sans-serif; color:#000;
           }

.container {
           padding:0px;
           width:122px;
           background:#FFF;
           }

.list      {
           padding:0px 0px 0px 6px;
           background-image: url(http://www.experts-exchange.com/images/marker.gif);
           background-repeat: no-repeat;
           background-position: left center
           height:30px;
           margin-top: 6px;
           }
//-->
</style>
</head>
<body>
<div class="container">
  <div class="list">Item 1</div>
  <div class="list">Item 2</div>
  <div class="list">Item 3</div>
  <div class="list">Item 1 is way too long</div>
</div>
</body>
</html>
0
 

Author Comment

by:mnahas
ID: 9727009
Thank you guys for both your answers.  I really liked georgemarian's detailed answer, but I needed something without span/div. Although, it provides lots of control to every line.  The table is something I am working with right now and was closer to what I was looking for!

Thank You for your answers!
0
 
LVL 31

Expert Comment

by:seanpowell
ID: 9727030
No problem - an A would have been nice for {Slam} given that he gave you a couple of options there ;-)
Thanks,
GM
0

Featured Post

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article demonstrates how to create a simple responsive confirmation dialog with Ok and Cancel buttons using HTML, CSS, jQuery and Promises
When crafting your “Why Us” page, there are a plethora of pitfalls to avoid. Follow these five tips, and you’ll be well on your way to creating an effective page.
In this tutorial viewers will learn how to position overlapping items using z-index in CSS. They will also learn the restrictions on the z-index property.  Create a new HTML document with an internal stylesheet.: Create a div in CSS and name it Red.…
The viewer will learn the basics of jQuery including how to code hide show and toggles. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery…

749 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question