List style none bootstrap 5

Advertisements

Bootstrap Lists

In this tutorial you will learn how to style HTML lists with Bootstrap.

Creating Lists With Bootstrap

You can create three different types of HTML lists:

  • Unordered lists A list of items in which the order does not explicitly matter. The list items in unordered lists are marked with bullets, e.g. , , etc.
  • Ordered lists A list of items in which the order does explicitly matter. The list items in ordered lists are marked with numbers, e.g. 1, , etc.
  • Definition list A list of terms with their associated descriptions.

See the tutorial on HTML lists, to learn more about the different lists types.

Unstyled Ordered and Unordered Lists

Sometimes you might need to remove the default styling form the list items. You can do this by simply applying the class .list-unstyled to the respective

    or
      elements.

      Example

      Try this code »
      • Home
      • Products
        • Gadgets
        • Accessories
      • About Us
      • Contact

      The output of the above example will look something like this:

      Note: The .list-unstyled class removes the default list-style and left padding only from the list items which are immediate children of the

        or
          element.

      Placing Ordered and Unordered List Items Inline

      If you want to create a horizontal menu using the ordered or unordered list you need to place all list items in a single line [i.e. side by side]. You can do this simply by adding the class .list-inline to the

        or
          , and the class .list-inline-item to the child
        1. elements.

          Example

          Try this code »
          • Home
          • Products
          • About Us
          • Contact

          The output of the above example will look something like this:

          Creating Horizontal Definition Lists

          The terms and descriptions in a definition list can also be aligned horizontally side-by-side using the Bootstrap grid system's predefined classes. Here's an example:

          Example

          Try this code »
          User Agent An HTML user agent is any device that interprets HTML documents. Client-side Scripting Client-side scripting generally refers to the category of computer programs on the web that are executed by the user's web browser. Document Tree The tree of elements encoded in the source document.

          The output of the above example will look something like this:

          Note: For longer definition terms, you can optionally apply the class .text-truncate on the element to truncate the text with an ellipsis [].

          In the next chapter you will learn how to create even more flexible and complex list of elements using the Bootstrap list group component.

          Previous Page Next Page
          Advertisements

          Video liên quan

Chủ Đề