Alignment of list items : li « Tags « HTML / CSS






Alignment of list items

    
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
        "http://www.w3.org/TR/2000/REC-xhtml1-20000126/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
  <meta http-equiv="content-type" content="text/html; charset=utf-8" />
  <title>Alignment of list items</title>
  <style type="text/css">
    p {
      margin: 0.75em 0 0 1.5em; 
      padding: 0;
      width: 33em;
      border: 1px dotted black;
    }
    ul {
      list-style-type: square;
      list-style-position: outside;
      margin: 0.75em 0 0 0; 
      padding: 0 0 0 1.5em;
      width: 34.5em;
      border: 1px dashed black;
    }
    ul.indent {
      margin: 0.75em 0 0 1.5em; 
      width: 33em;
    }
    li {
      margin: 0.75em 0 0 0;
      border: 1px dotted black;
    }
  </style>
</head>
<body>
  <p>  this is a test. this is a test. this is a test. 
  this is a test. this is a test. this is a test. 
  this is a test. this is a test. this is a test. 
  this is a test. this is a test. this is a test. 
  this is a test. this is a test. this is a test. 
  this is a test. </p>
  <ul>
    <li>L.</li>
    <li>L.</li>
  </ul>
  <p>  this is a test. this is a test. this is a test. 
  this is a test. this is a test. this is a test. 
  this is a test. this is a test. this is a test. 
  this is a test. this is a test. this is a test. 
  this is a test. this is a test. this is a test. 
  this is a test. </p>
  <ul class="indent">
    <li>L.</li>
    <li>L.</li>
  </ul>
  <p>  this is a test. this is a test. this is a test. 
  this is a test. this is a test. this is a test. 
  this is a test. this is a test. this is a test. 
  this is a test. this is a test. this is a test. 
  this is a test. this is a test. this is a test. 
  this is a test. </p>
</body>
</html>

   
    
    
  








Related examples in the same category

1.'li' creates one item in a list
2.Nested LI tag
3.Add style to an anchor in a LI tag
4.Define class for
  • to set its font weight to bold
  • 5.LI width: 33%
    6.LI margin: 0 0 0.25em 0
    7.LI font: 1.1em/1.2 Verdana, Arial, Verdana, sans-serif;
    8.Set display to inline to a LI under a UL in DIV
    9.Alignment of list items with margin
    10.Three level list
    11.Inline centred list
    12.Right-aligned bullets
    13.Tab like list
    14.li list-style-type: lower-roman;
    15.li text-indent: -0.75em;
    16.UL LI bullet image
    17.LI display: inline;
    18.LI list-style-type: none;
    19.LI line-height: 44px;
    20.List with no margin
    21.Margin for list
    22.Without list type
    23.li { list-style-image: url("http://java2s.com/style/logo.png");}
    24.list-style-position:inside;list-style-position:outside;
    25.list-style: lower-roman inside;
    26.List order and start
    27.nested ordered and unordered lists
    28.HTML for a definition list
    29.HTML and CSS for vertical and horizontal lists
    30.Selecting elements in nested lists
    31.HTML and CSS for two lists with different list-style properties
    32.HTML and CSS for displaying ordered list style types
    33.HTML and CSS for mixed list-style-type values
    34.Using the display property to make a list display inline
    35.Definition List Example
    36.Unordered List Example
    37.Scrolled List Example
    38.Nested Lists
    39.List types
    40.Lists as navigation
    41.Here is a definition list
    42.a nested ordered list
    43.Dropdown List Example
    44.Link list inside a DIV
    45.Page list bottom bar
    46.ul li list-style-type: square;
    47.Image and text list
    48.Using Arrow Image for LI list
    49.For unordered lists, there are three: disc, square, and circle.
    50.For ordered lists, there are eleven different styles of marker:
    51.The marker can be removed from either ordered or unordered lists with the none keyword.
    52.Setting style for LI inside a DIV
    53.line-height: 44px; for li
    54.Using double arrow sign for UI LI
    55.Link styles