Css bullet list no bullets

CSS Lists

The list-style-type property specifies the type of list item marker.

The following example shows some of the available list item markers:

Example

ol.c list-style-type: upper-roman;
>

ol.d list-style-type: lower-alpha;
>

Note: Some of the values are for unordered lists, and some for ordered lists.

An Image as The List Item Marker

The list-style-image property specifies an image as the list item marker:

Example

Position The List Item Markers

The list-style-position property specifies the position of the list-item markers (bullet points).

«list-style-position: outside;» means that the bullet points will be outside the list item. The start of each line of a list item will be aligned vertically. This is default:

«list-style-position: inside;» means that the bullet points will be inside the list item. As it is part of the list item, it will be part of the text and push the text at the start:

Example

ul.a <
list-style-position: outside;
>

ul.b list-style-position: inside;
>

Remove Default Settings

Example

List — Shorthand property

The list-style property is a shorthand property. It is used to set all the list properties in one declaration:

Example

When using the shorthand property, the order of the property values are:

  • list-style-type (if a list-style-image is specified, the value of this property will be displayed if the image for some reason cannot be displayed)
  • list-style-position (specifies whether the list-item markers should appear inside or outside the content flow)
  • list-style-image (specifies an image as the list item marker)

If one of the property values above is missing, the default value for the missing property will be inserted, if any.

Styling List With Colors

We can also style lists with colors, to make them look a little more interesting.

    or
    tag, affects the entire list, while properties added to the
    tag will affect the individual list items:

Example

ol <
background: #ff9999;
padding: 20px;
>

ul background: #3399ff;
padding: 20px;
>

ol li background: #ffe5e5;
color: darkred;
padding: 5px;
margin-left: 35px;
>

ul li background: #cce5ff;
color: darkblue;
margin: 5px;
>

More Examples

Customized list with a red left border
This example demonstrates how to create a list with a red left border.

Full-width bordered list
This example demonstrates how to create a bordered list without bullets.

All the different list-item markers for lists
This example demonstrates all the different list-item markers in CSS.

All CSS List Properties

Property Description
list-style Sets all the properties for a list in one declaration
list-style-image Specifies an image as the list-item marker
list-style-position Specifies the position of the list-item markers (bullet points)
list-style-type Specifies the type of list-item marker

Источник

CSS Bullet Points and Numbered Lists

CSS Bullet Point Lists - CSS3 Tutorial

But as these CSS3 Tutorials assume no prior knowledge, let’s do things one step at a time!

Changing the Bullet Style

    and
    level. This means you can set the same appearance for all bullets in a list or set individual styles per bullet point, if you really want to.

Basic Bullet Styles – Square, Disc, Circle

To set the bullet appearance you can use CSS’ list-style or list-style-type . list-style-type is the exact property we are changing here, but you can also use list-style to change multiple properties, which we will come to shortly.

As with HTML Bullets, you can set these as circle, square or disc. Why do it with CSS if you can do it in HTML? Well, if you use an external CSS file, you can set it once and all your bullet lists are consistent:

  • You don’t have to remember to set the bullet appearance each time.
  • After the first list you create, subsequent lists use fewer bytes of code, making the page quicker to load.

Using an Image For a Custom Bullet Point List

One thing you can’t do easily with HTML alone is create custom bullet points. With Cascading Style Sheets, this is a breeze. Firstly you’ll need to create an image ready. I created a simple 10px × 10px PNG ready for this exercise.

To switch a ‘standard’ bullet point appearance for your custom image, you need to use list-style-image which takes a url() value, like this:

Bullet Point Position

When you first create a bullet list in HTML, your browser will assign a padding and margin to both your UL and LI elements. To get full control you are best setting your desired padding and margin straight away.

On top of that CSS gives you the list-style-position property. There’s a great demo of this over at CSS Tricks.

list-style-property takes two values: inside or outside. You’ll need to play with your code to find the most appropriate setting for your web page.

Combining These Into list-style

I said earlier that list-style is a shorter version but that takes multiple properties. Take a look here:

Using a shorthand method in CSS saves you bytes of data, and RSI in typing! If you would rather set each line individually, then feel free. Just know there is a quicker way!

Ordered List Styles

  1. armenian
  2. cjk-ideographic
  3. decimal
  4. decimal-leading-zero
  5. hebrew
  6. hiragana
  7. lower-alpha
  8. lower-greek
  9. lower-latin
  10. lower-roman
  11. upper-alpha
  12. upper-latin
  13. upper-roman

It’s probably not a good idea to do what I have done here – that will confuse users. But if you prefer Roman Numerals for your lists, for example, you can do that in CSS.

Bullet Lists With No Bullets in CSS

Why would you use a bullet list, if you intended on not using bullets of some description? Sometimes in web design, using a pattern which repeats (which a bullet list does) is a good way to layout certain items on the page. A ‘recent products’ added to an e-commerce shop might be one example. Another application which is commonly used now is to employ an unordered list to create a navigation bar. I will go into this in more detail later, but you can set a bullet list to have no bullets really easily:

Remember doing it this will actually do that to all your unordered lists. So you may want to be more granular than that either with CSS Classes, or by specifying a hierarchy. If you just want this to be done inside your tags you can remove the bullets like so:

Demo File

I have created a demo file for you to download showing some of these options.

As always if you need any more help then get in touch!

More CSS3 Tutorials

Spread the Word

Recent Posts

Categories

Источник

How to Make Unordered List without Bullets HTML

If you’re trying to remove bullets from HTML unordered list. Then, this tutorial will teach you how to make an unordered list without bullets in HTML.

HTML ul lists are marked with bullets, squares, discs, or circles. CSS allows us to remove these bullets in just a few steps. In this tutorial, we’ll explore different methods to do this.

Making Unordered List Without Bullets HTML

We are going to see the following three methods. If you want to jump to the specific method then you can just click the links.

Let’s begin with the first method.

Method #1: Use CSS “ list-style-type ” Property

Оцените статью