Two columns Three columns Mixed cols and rows Gallery Archives Clean & Clear Dark or Black High Contrast/ Impact Blog Designs New Corporate/ Professional Unconventional Designs Liquid layouts Web Design Firms Our Favorites What's Popular Last 20 submissions
Horizontal Menus Vertical Menus Multiple/ Nested Levels

CSS Examples Markerless and “no indent” Lists

Date: 09/27/2004 Markerless and “no indent” Lists

Author: CSS Drive

Removing the default marker that appear to the left of lists is useful when you wish to use lists purely for semantic reasons or to fully customize visually. The below CSS removes both the marker and changes the indentation of the list so it's inline with normal content. The combination of "padding: 0" and "margin-left: 0" ensures the indentation is consistent across browsers.

  • News
  • Sports
  • Technology
  • Webmaster

The HTML:

<ul>
<li>News</li>
<li>Sports</li>
<li>Technology</li>
<li>Webmaster</li>
</ul>

The CSS:

ul{
list-style-type: none;
padding: 0;
margin-left: 0;
font-weight: bold;
}

Comments (5)

gdfg

#1: fdgfd on 01/26 at 02:35 PM

gfdgfdg

#2: fdgfd on 01/26 at 02:35 PM

doesn't work on me. the bullets are gone yet the whole list is still indented. I've tried to use this:

li{ list-style-type: none; padding: 0; margin-left: -25px;}

well, i'm still searching for the best solution on this. im planning to have it hovered.

li a:hover { }

i'll post on this soon..

#3: Richard Badlisan on 02/19 at 03:41 AM

Hey Richard use this code:

ul {
list-style: none;
margin-left: 0;
padding-left: 1em;
text-indent: -1em;
}
It works for me now. If used the same code as presented in this site it did not work because my list wasn't inside a DIV.

Regards.

#4: Luis Correia on 03/25 at 08:47 PM

Ooops the DIV I mentioned has nothing to do with the list indent.

#5: Luis Correia on 03/25 at 08:56 PM

Post a Comment: Guest (Login or Register)

Name: (Required)

Email: (Required)

(NOT shown on page)

URL:

(Shown on page if entered)

Comments: (Required)

Remember my personal information
Notify me of follow-up comments?

Submit the word you see below:


CSS Forums

CSS Forums: latest threads Last Post Info
Cant design (1) 05/16/2008 12:28 pm
By: tarik
How to show an entire pdf in one div (2) 05/14/2008 11:07 am
By: Grundic
Starting A Web Design Business - How Do I Attract Customers? (10) 05/13/2008 02:37 pm
By: april
Download.. Pacific Wings multicolor menu (1) 05/13/2008 03:05 am
By: sebreh
Check out this website I am working on CRITIQUE. (5) 05/13/2008 01:20 am
By: abran