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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T19:13:54+00:00 2026-06-01T19:13:54+00:00

I have a list of li elements inside a ul with associated style classes

  • 0

I have a list of li elements inside a ul with associated style classes (below). What I want is for every list item to be along the left edge of the page. Putting borders around both ul and li I can see that the li items are indented exactly 40px inexplicably.

I’ve tried margin-left: 0px on both elements and I’ve tried list-style:none; which does help to eliminate the bullets and slide everything left up to the indestructible 40px margin.

I’ve determined through trial and error that if I do this in my li:

left: -40px;
position: relative;

I get the desired result but the margin merely pops to the right side / tail of each li which is less troublesome visually but still a terrible hack. There must be a way to make it disappear?

My style code looks like this:

ul.selectorlist
{
    list-style: none;
    padding: none;
    margin: 0px;

    border-width: 1px;
    border-style: solid;
    border-color: white;
}


li.channel
{
//  left: -40px; // <- Does the trick but COME ON, REALLY?!

    width: 100%;
    background-colour: black;
    font-family:georgia;
    font-size:18px;
    padding: 0px;
    margin: 0 0 0 0;

    border-width: 1px;
    border-style: solid;
    border-color: white;
}

Note:

I have also played around with:

list-style-position: inside / outside;

Which actually pops the li bullets on the left and right sides of the 40px line.

  • 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-06-01T19:13:56+00:00Added an answer on June 1, 2026 at 7:13 pm

    A little experimenting (in FireFox 11) shows that the default layout for a list includes a 40px left padding, which is there to make room for the bullets.

    Add

    padding:0;
    

    to the styles for the <ul> and your mysterious gap should disappear. However, this may have undesirable consequences with regard to the bullet position. Getting rid of the bullets or setting list-style-position to inside are both possible remedies, depending on your particular layout requirements.

    Note that this padding is on the <ul> element, which, when you add borders, is visually similar to a margin on the <li>. This is one reason why development tools like Firebug or those included in Chrome and IE are so useful—it’s very easy to see the box model of any element.

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

Sidebar

Related Questions

I have an array list called str, i want to see the elements inside
I have list elements like so: <li> <strong style=color: #BBB;>1</strong> <a href=>Matt</a> <b>4 days
I have a list of elements that I want to split into individual lists
I have a few list elements, like this: <li class=item> <a class=toggle><h4>ämne<small>2010-04-17 kl 12:54
I have a list of elements and want to takeWhile the sum (or any
OK, I have a list ( <ul> ) then inside each <li> element I
I have a list of elements (the X in the following examples) displayed either
I have a list of elements which I would like to make sortable and
I have a list of elements, and I've been using will_paginate up until now,
I have a list where elements are hidden for multiple reasons, each corresponding to

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.