Solved

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

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

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Suggested Solutions

When it comes to write a Context Sensitive Help (an online help that is obtained from a specific point in state of software to provide help with that state) ,  first we need to make the file that contains all topics, which are given exclusive IDs. …
Building a website can seem like a daunting task to the uninitiated but it really only requires knowledge of two basic languages: HTML and CSS.
In this tutorial viewers will learn how to embed videos in a webpage using HTML5. Ensure your DOCTYPE declaration is set to HTML5: "<!DOCTYPE html>": Use the <video> tag to insert a video. Define the src as the URL of your video; this is similar to …
The viewer will learn the benefit of using external CSS files and the relationship between class and ID selectors. Create your external css file by saving it as style.css then set up your style tags: (CODE) Reference the nav tag and set your prop…

710 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