Solved

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

Posted on 2003-11-10
5
2,741 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
  • 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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Introduction The Google Maps API offers various ways to draw dynamic and static maps.  Using a combination of PHP and JavaScript, you can draw active JavaScript maps that allow pan-and-zoom in the client browser window.  You can also draw "static" …
Things That Drive Us Nuts Have you noticed the use of the reCaptcha feature at EE and other web sites?  It wants you to read and retype something that looks like this.Insanity!  It's not EE's fault - that's just the way reCaptcha works.  But it is …
In this tutorial viewers will learn how to position items using CSS's three positioning types Create a new HTML document with an internal stylesheet.: Create another div in CSS and name it Absolute : Type "position:absolute;" and "top:10px; left:50p…
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.…

929 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

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now