skip to main content
Select font family
Select colour theme
Profile picture - Ahmad Ainul Rizki Ahmad Ainul Rizki
Profile logo - Ahmad Ainul RizkiCD
  • Home
  • About me
  • Now
  • Portfolio
  • Blog
  • Components

Ordered list

An ordered list groups items that have a numerical ordering.

  • Follow me on Twitter twitterlink to twitter profile
  • View my Github profile githublink to github profile
  • View my Codepen profile codepenlink to codepen profile
  1. Stop
  2. Look
  3. Listen

Ordered lists should:

  • be used if the order of the items is relevant

Ordered lists should not:

  • be used if the order of the items is not relevant

Code

Use the tabs to view the ordered list source code.

Use left and right arrows to navigate between tabs.
  • HTML
  • CSS

HTML

                      
                      
  <ol class="ordered-list">
    <li class="ordered-list__list-item">Stop</li>
    <li class="ordered-list__list-item">Look</li>
    <li class="ordered-list__list-item">Listen</li>
  </ol>

                    

CSS


  /*
  Ordered lists
  ----------------------------------- */

.ordered-list {
  list-style: none;
  margin: 2rem 0;
  padding-left: 1rem;
  line-height: 2;
  max-width: 80%;
  margin-bottom: 1.5rem;
}

.ordered-list__list-item {
  margin-bottom: .4rem;
  list-style-type: decimal;
}


                    
Back to all components
  • Home
  • About me
  • Now
  • Portfolio
  • Blog
  • Components
  • Follow me on Twitter twitterlink to twitter profile
  • View my Github profile githublink to github profile
  • View my Codepen profile codepenlink to codepen profile

Proudly powered by Eleventy. Hosted on Netlify, last updated September 15th 2020, at 10:55:45 - privacy.