Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

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

Posted on 2003-11-10
5
Medium Priority
?
2,756 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 150 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

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

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

Use these top 10 tips to master the art of email signature design. Create an email signature design that will easily wow recipients, promote your brand and highlight your professionalism.
Ever visit a website where you spotted a really cool looking Font, yet couldn't figure out which font family it belonged to, or how to get a copy of it for your own use? This article explains the process of doing exactly that, as well as showing how…
In this tutorial viewers will learn how to embed Flash content in a webpage using HTML5. Ensure your DOCTYPE declaration is set to HTML5: "<!DOCTYPE html>": Use the <object> tag to embed Flash content.: To specify that the object is Flash content, d…
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…

671 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