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

  • Home
  • SEARCH
  • 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 635307
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T20:23:25+00:00 2026-05-13T20:23:25+00:00

I have the code, as below. It’s a bit annoying to have the text

  • 0

I have the code, as below. It’s a bit annoying to have the text not align (it affects other li elements). How can I make it a fixed-width? I’ve tried width=XYZpx but that did nothing.

<li class="date">2/28/2010 9:37:38 AM</li>
...
<li class="date">3/1/2010 9:37:38 AM</li>

css

li.date
{ 
  background : url(/icons/date.png) no-repeat left top;
}
  • 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-13T20:23:26+00:00Added an answer on May 13, 2026 at 8:23 pm

    Assuming the following (x)html:

    <div id="navigation">
      <ul>
        <li class="date">List item One</li>
        <li class="date">List item Two</li>
      </ul>
    </div>
    

    The width of the li elements can be set by either setting the width of the div#navigation (as the ul and li will default to display: block at 100% width + padding + border-widths):

    div#navigation {width: 200px; }
    

    Or by setting the width of the ul

    div#navigation > ul {width: 200px; }
    

    Or by setting the width of the li elements themselves:

    div#navigation > ul > li.date {width: 200px; }
    

    I think, unless there was a major typo in your question, that you’re trying to assign the width incorrectly, certainly as regards the width=XYZpx that you posted. To assign the width this way you should quote the value, so it becomes:

    ...width="XYZpx"...
    

    But bear in mind that this is html/xhtml, not css. To set the width with css you should use either:

    ...style="width: 200px;"...
    

    If you want to use inline-styles, or, in the stylesheet, use the form (as above):

    element.selector {width: 200px; }
    

    Your comments regarding the text’s alignment suggests that your li elements are perhaps inheriting padding, or a text-indent from somewhere, so you might want to add the styles:

    div#navigation > ul > li.date {
      text-indent: 0;
      padding: 0;
    }
    

    Hope this helps. If I’ve misunderstood your question, or problem, please feel free to drop a comment to my answer, or revise/edit/clarify your question, and I’ll try to be more useful.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Ask A Question

Stats

  • Questions 336k
  • Answers 336k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer I can store a CurrentOffset field that will need to… May 14, 2026 at 3:48 am
  • Editorial Team
    Editorial Team added an answer If you're looking for something simple, you might consider an… May 14, 2026 at 3:48 am
  • Editorial Team
    Editorial Team added an answer You need to use the instanceof keyword to check the… May 14, 2026 at 3:48 am

Related Questions

I am currently running into a problem where an element is coming back from
I have a JSP page retrieving data and when single or double quotes are
How do we do the smooth animation. I have the code as below. ThicknessAnimation
I have the following code in my Site.Master page of an almost empty ASP.NET
I have a form with checkboxes and then text to the right of the

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

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.