Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 550171
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T11:15:37+00:00 2026-05-13T11:15:37+00:00

This is my code: <div id=divCategoryMenu name=divCategoryMenu style=background-color:#BCD2E6;> <ul id=ulCategoryMenu name=ulCategoryMenu> </ul> </div> The

  • 0

This is my code:

<div id="divCategoryMenu" name="divCategoryMenu" style="background-color:#BCD2E6;">
  <ul id="ulCategoryMenu" name="ulCategoryMenu">

  </ul>
</div>

The list is dynamically filled. But there is a problem:

When the list fills inside this Div, the items are center-aligned by default when I have not used any align property in the above code and also in the code that I am using to dynamically fill it. How to align so that items appear and look like this:

alt text http://www.freeimagehosting.net/uploads/b0f0daf6a2.jpg

At present it is displayed in a dirty form like this:

alt text http://www.freeimagehosting.net/uploads/901540953d.jpg

**** Edited ****

In my case, the items are actually labels not

  • . Secondly, what CSS to include to give it a look like the first image.

    **** Edited further ****

    The CSS code for the hard-coded HTML of the first image looks like this:

    <style type="text/css">
    
    .urbangreymenu{
    width: 200px; /*width of menu*/
    }
    
    .urbangreymenu .headerbar{
    font: bold 12px Verdana;
    color: white;
    background:#006699 url(media/arrowstop.gif) no-repeat 8px 6px; /*last 2 values are the x and y coordinates of bullet image*/
    margin-bottom: 0; /*bottom spacing between header and rest of content*/
    text-transform: uppercase;
    padding: 7px 0 7px 31px; /*31px is left indentation of header text*/
    }
    
    .urbangreymenu ul{
    list-style-type: none;
    margin: 0;
    padding: 0;
    margin-bottom: 0; /*bottom spacing between each UL and rest of content*/
    }
    
    .urbangreymenu ul li{
    padding-bottom: 2px; /*bottom spacing between menu items*/
    }
    
    .urbangreymenu ul li a{
    font: normal 12px Arial;
    color: black;
    background: #E4F0F5;
    display: block;
    padding: 5px 0;
    line-height: 12px;
    padding-left: 8px; /*link text is indented 8px*/
    text-decoration: none;
    }
    
    .urbangreymenu ul li a:visited{
    color: black;
    }
    
    .urbangreymenu ul li a:hover{ /*hover state CSS*/
    color: white;
    background: black;
    }
    
    
    .style14 {font-family: Verdana, Arial, Helvetica, sans-serif}
    .style15 {font-family: Verdana, Arial, Helvetica, sans-serif; color: #006699; font-size: 11px;}
    </style>
    
    • 1 1 Answer
    • 0 Views
    • 0 Followers
    • 0
    Share
    • Facebook
    • Report

    Leave an answer
    Cancel reply

    You must login to add an answer.

    Forgot Password?

    Need An Account, Sign Up Here

    1 Answer

    • Voted
    • Oldest
    • Recent
    • Random
    1. Editorial Team
      Editorial Team
      2026-05-13T11:15:38+00:00Added an answer on May 13, 2026 at 11:15 am

      Like RegDwight says, it’s about margin/padding not alignment. You have to add the following style items to your UL item, and also to the actual LI items of your list.
      Update: Actually a little more had to be done to get the white spaces between the list items. See the code below.

      Since the LI items are generated and not present on your initial HTML code, you have to define their styles in CSS as children of your UL item.

      Update: I had to edit the code a little to make it look exactly like in your example. I’ve pasted the complete new HTML and CSS, it should be ok now.

      <html><head>
      <style type="text/css">
      .urbanbluemenu{
          width: 200px; /*width of menu*/
      }
      
      ul#ulCategoryMenu {
          background-color: white;
          margin: 0;
          padding: 0;
          list-style-type: none;
      }
      ul#ulCategoryMenu li {
          background-color: #BCD2E6;
          margin: 2px 0 2px 0;
          padding: 0 0 0 10px;
      }
      
      </style>
      </head>
      <body>
      
      <div class="urbanbluemenu" id="divCategoryMenu" name="divCategoryMenu">
        <ul id="ulCategoryMenu" name="ulCategoryMenu">
           <li><label>John</label></li>
           <li><label>Bill</label></li>
        </ul>
      </div>
      
      </body>
      </html>
      
      • 0
      • Reply
      • Share
        Share
        • Share on Facebook
        • Share on Twitter
        • Share on LinkedIn
        • Share on WhatsApp
        • Report

    Sidebar

    Related Questions

    this is my code : <div id=test style=width:200px;height:100px;background:red class=tabs change_font_size> <div> <a class=delete style=float:right;font-size:20px;text-decoration:underline;cursor:pointer;>delete</a>
    Suppose to have a code like this: <div class=notSelected> <label>Name <input type=text name=name id=name
    Why does this code work: $('div.error_container').html('<div class=error>No more foo allowed</div>'); But this code causes
    This code has different result in Firefox and Chrome <div style=border:1px solid red; width:50%;
    i have this code <div id=aggregate style=display:inline> <%=Html.RadioButton(a, 1, true, new {id = meRadio})%><label>Me</label>
    I have this code: var $msg = jQuery('<div></div>') .hide() .appendTo(document.body) ; if ($msg.is(:hidden)) {
    Consider this sample code: <div class=containter id=ControlGroupDiv> <input onbeforeupdate=alert('bingo 0'); return false; onclick=alert('click 0');return
    I have HTML code like this : <div> <a>Link A1</a> <a>Link A2</a> <a>Link A3</a>
    Say I have jquery code like this: html += '<div class=index>' + item.index +
    I have html code that looks roughly like this: <div id=id1> <div id=id2> <p>some

    Explore

    • Home
    • Add group
    • Groups page
    • Communities
    • Questions
      • New Questions
      • Trending Questions
      • Must read Questions
      • Hot Questions
    • Polls
    • Tags
    • Badges
    • Users
    • Help
    • SEARCH

    Footer

    © 2021 The Archive Base. All Rights Reserved
    With Love by The Archive Base

    Insert/edit link

    Enter the destination URL

    Or link to existing content

      No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.