How To Display Unordered List In Two Columns - W3docs

w3docs logo Books Learn HTML Learn CSS Learn Git Learn Javascript Learn PHP Learn python Learn Java Exercises HTML JavaScript Git CSS PHP Courses Quizzes Snippets Tools General Tools
  • Password Generator
  • HTML Editor
  • HTML Encoder
  • Base 64
  • Code Diff
  • JSON Beautifier
  • CSS Beautifier
  • Markdown Convertor
  • Find the Closest Tailwind CSS Color
  • Phrase encrypt / decrypt
  • Browser Feature Detection
  • Number convertor
CSS Maker
  • CSS Maker
  • CSS Maker text shadow
  • CSS Maker Text Rotation
  • CSS Maker Out Line
  • CSS Maker RGB Shadow
  • CSS Maker Transform
  • CSS Maker Font Face
Color Tools
  • Color Picker
  • Colors CMYK
  • Colors HWB
  • Colors HSL
  • Color Hex
  • Color mixer
  • Color Converter
  • Colors RGB
  • Color Contrast Analyzer
  • Color Gradient
String Tools
  • String Length Calculator
  • MD5 Hash Generator
  • Sha256 Hash Generator
  • String Reverse
  • URL Encoder
  • URL Decoder
  • Base 64 Encoder
  • Base 64 Decoder
  • Extra Spaces Remover
  • String to Lowercase
  • String to Uppercase
  • Word Count Calculator
  • Empty Lines Remover
  • HTML Tags Remover
  • Binary to Hex
  • Hex to Binary
  • Rot13 Transform on a String
  • String to Binary
  • Duplicate Lines Remover
Change theme
  • Dark
  • Light
  • System
  • Books
    • Learn HTML
    • Learn CSS
    • Learn Git
    • Learn Javascript
    • Learn PHP
    • Learn python
    • Learn Java
  • How To
    • How To NodeJs
    • How To Linux
    • How To AngularJs
    • How To PHP
    • How To HTML
    • How To CSS
    • How To Symfony
    • How To Git
    • How To Apache
    • How To JavaScript
    • How To Java
    • How To Vue.js
    • How To Python
  1. Snippets
  2. HTML
  3. How to Display Unordered List in Two Columns
How to Display Unordered List in Two Columns

In this tutorial, you can see how to display an unordered list in two columns with a little CSS. We’ll demonstrate examples with the CSS columns and column-count properties.

Create HTML

  • Use the <ul> element for an unordered list and add <li> elements.
<ul> <li>Some text</li> <li>Some text</li> <li>Some text</li> <li>Some text</li> <li>Some text</li> <li>Some text</li> </ul>

Add CSS

  • Use the columns property and specify “2” as a value. Also, add the -webkit- and -moz- prefixes.
ul { columns: 2; -webkit-columns: 2; -moz-columns: 2; }

Example of displaying an unordered list in two columns with the columns property:

<!DOCTYPE html> <html> <head> <title>Title of the document</title> <style> ul { columns: 2; -webkit-columns: 2; -moz-columns: 2; } </style> </head> <body> <ul> <li>Some text</li> <li>Some text</li> <li>Some text</li> <li>Some text</li> <li>Some text</li> <li>Some text</li> </ul> </body> </html> Try it Yourself »

Result

  • Some text
  • Some text
  • Some text
  • Some text
  • Some text
  • Some text

Example of displaying an unordered list in two columns with the column-count property:

<!DOCTYPE html> <html> <head> <title>Title of the document</title> <style> ul { column-count: 2; column-rule: dotted 1px #333; list-style-type: none; } </style> </head> <body> <ul> <li>Some text</li> <li>Some text</li> <li>Some text</li> <li>Some text</li> <li>Some text</li> <li>Some text</li> </ul> </body> </html> Try it Yourself » Tags lists css html

Related Resources

  • How to Remove, Replace or Style List Bullets with Pure CSS
  • How to Adjust the Position of List Style Image
  • How to Make the Cursor a Hand When Hovering Over a List Item
Sorry about that How can we improve it? Submit Thanks for your feedback! Thanks for your feedback! Do you find this helpful? Yes No Quizzes
  • PHP basics
  • HTML Basics
  • Javascript Basics
  • CSS Basics
  • ES6 Basics
  • TypeScript Basics
  • React Basics
  • Angular Basics
  • Sass Basics
  • Git Basics
  • Vue.js Basics
  • SQL Basics
  • Python Basics
  • Java Basics
  • NodeJS Basics

Từ khóa » Html Ul Li Grid