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 7526437
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T03:49:49+00:00 2026-05-30T03:49:49+00:00

I am having trouble getting my LI elements to align closer to the left

  • 0

I am having trouble getting my LI elements to align closer to the left side of their container. I have my HTML below, and when it displays the LI elements have a margin on the left of about 30 pixels. I would like to see how I could make that flush against their container, and then once I understand that technique, I can adjust it so there is some left padding.

Btw, I did create a fiddle with this to make it easier to see the problem, but unfortunately jsFiddle shows the result I want to see! If the below HTML is copied/pasted to a file and brought up in Chrome, it looks different (each LI is shifted to the right).

Here is the HTML…

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
<head>
    <style type="text/css">
        .parentSelectorBox
        {
        }
        .parentSelectorBox .fieldsBox
        {
            border: 1px solid blue;
            width: 250px;
            margin: 5px;
            float: left;
        }
        .parentSelectorBox .actionButtonsBox
        {
            border: 1px solid blue;
            width: 100px;
            margin: 5px;
            float: left;
        }
        .parentSelectorBox .availableFields
        {
            border: 1px solid pink;
            height: 100px;
            overflow: auto;
        }
        .parentSelectorBox ul li
        {
            height: 20px;
            list-style-type: none;
            margin: 0 10 0 -15px;
            padding: 0 10 0 -15px;
            white-space: nowrap;
            marker-offset: 105px;
        }
    </style>
</head>
<body>
    <div id="parentSelectorBox" class="parentSelectorBox">
        <div id="availableFieldsBox" class="fieldsBox">
            <div id="availableFields" class="availableFields">
                <ul>
                    <li>A</li>
                    <li>A</li>
                    <li>A</li>
                    <li>A</li>
                    <li>A</li>
                    <li>A</li>
                    <li>A</li>
                    <li>A</li>
                    <li>A</li>
                    <li>A</li>
                    <li>A</li>
                    <li>A</li>
                    <li>A</li>
                    <li>A</li>
                </ul>
            </div>
        </div>
    </div>
</body>
</html>
  • 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-30T03:49:50+00:00Added an answer on May 30, 2026 at 3:49 am

    You need to remove the padding property of the ul:

    .parentSelectorBox ul {
        margin: 0;
        padding: 0
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm having trouble getting the right number of elements in the ArrayList alt in
I'm having trouble getting my CSS to work :( HTML <form action=/api/submit/ method=post> <textarea
I'm having trouble getting the elements in my <div id=wrapper> to push down my
Im new to web development and Im having some trouble getting my elements to
I have managed to parse ok. But now I am having trouble getting the
I'm having trouble getting IE7 to float my elements correctly (FF and Chrome work
I am having trouble getting these two elements to work at the same time
I have been having trouble getting this plugin to attach correctly to ajax loaded
I'm having trouble getting post DOM created elements to inherit jquery events. As I
I'm having trouble getting the right size of a vector with struct elements. The

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.