Jump to content

CSS for making list to center

- - - - -

This topic has been archived. This means that you cannot reply to this topic.
7 replies to this topic

#1
cakka

cakka

    Programmer

  • Members
  • PipPipPipPip
  • 192 posts
Hi , i want to create a list with center position.
How to do this the list in DIV format , this is the codes that i created.

For HTML :

<div class="content">

<ul class="menu"><li class="leaf first"><a title="Solvent Distillation" href="/solvent-distillation.htm">Solvent Distillation |</a></li>

<li class="leaf"><a title="The Spray Gun Cleaner from NexGen" href="/spray-gun-cleaner.htm">Spray Gun Cleaner |</a></li>

<li class="leaf"><a title="Solvent Recycling" href="/solvent-recycling.htm">Solvent Recycling |</a></li>

<li class="leaf"><a title="Glove Box Cleaner and Manual Washer" href="/glove-box-cleaner.htm">Glove Box Cleaner |</a></li>

<li class="leaf last"><a title="Degreasing Machinefrom NexGen" href="/degreasing-machines.htm">Degreasing Machine</a></li>

</ul>

</div>


For CSS:
div.content ul li{

  list-style: none;

  margin-left: -1px;

  font-style: none ;

}


Please tell me what the code that must i added or change.
Thanks

#2
John

John

    Writes binary right handed and hex left handed

  • Moderators
  • 6,321 posts
Do you want to position the list in the center of the div? Or position the div in the center of the page?

#3
cakka

cakka

    Programmer

  • Members
  • PipPipPipPip
  • 192 posts
Yes, in the center of the DIV tag.
How to do that ? Thanks

#4
morefood2001

morefood2001

    Speaks fluent binary

  • Members
  • PipPipPipPipPipPipPipPip
  • 1,720 posts
First, keep in mind that the following css is invalid:
font-style: none ;

This works correctly on both IE7 and FF3, I've shown borders also:

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">

<html>
<head>
    <meta http-equiv="content-type" content="text/html; charset=us-ascii">
    <meta name="author" content="Philip Matuskiewicz">
	
    <title>Untitled 1</title>
    <style type="text/css">
    div.content ul li{
  list-style: none;
  margin-left: -1px;
  text-align:center;
  border: 1px;
  border-style: solid;
}
    </style>
</head>

<body>
    <div class="content">
        <ul class="menu">
            <li class="leaf first"><a title="Solvent Distillation" href="/solvent-distillation.htm">Solvent Distillation |</a></li>

            <li class="leaf"><a title="The Spray Gun Cleaner from NexGen" href="/spray-gun-cleaner.htm">Spray Gun Cleaner |</a></li>

            <li class="leaf"><a title="Solvent Recycling" href="/solvent-recycling.htm">Solvent Recycling |</a></li>

            <li class="leaf"><a title="Glove Box Cleaner and Manual Washer" href="/glove-box-cleaner.htm">Glove Box Cleaner |</a></li>

            <li class="leaf last"><a title="Degreasing Machinefrom NexGen" href="/degreasing-machines.htm">Degreasing Machine</a></li>
        </ul>
    </div>
</body>
</html>


#5
cakka

cakka

    Programmer

  • Members
  • PipPipPipPip
  • 192 posts
Hi, thanks for your help . It just cleared :)
Sorry i am not giving you know ;)
How to mark this thread as solved ?

Very thanks

#6
morefood2001

morefood2001

    Speaks fluent binary

  • Members
  • PipPipPipPipPipPipPipPip
  • 1,720 posts
You simply leave the thread alone and it gets buried :)

#7
Xav

Xav

    Writes binary right handed and hex left handed

  • Members
  • PipPipPipPipPipPipPipPipPip
  • 13,118 posts
Unless we continue it *grins evilly*.
Jordan said:

Good members, like yourself, stick around and post for ages to come!
Mr. Xav | Blog | Forums

#8
cakka

cakka

    Programmer

  • Members
  • PipPipPipPip
  • 192 posts
Nice :)
Thanks for all reply ....

This thread is solved