View on GitHub

reading-notes

Reading notes taken while attending Code Fellows classes.

HTML Lists, Control Flow with JS and the CSS Box Model

Index

Home
Learn HTML
Learn CSS
Learn JS

Learn HTML

  1. Unordered Lists
    • When should you use an unordered list in your HTML document?
      • The <ul> element is for grouping a collection of items that do not have a numerical ordering, and their order in the list is meaningless. Typically, unordered-list items are displayed with a bullet, which can be of several forms, like a dot, a circle, or a square. The bullet style is not defined in the HTML description of the page, but in its associated CSS, using the list-style-type property.
    • How do you change the bullet style of unordered list items?
      • list-style-type Here are many examples
       /* Partial list of types */
       list-style-type: disc;
       list-style-type: circle;
       list-style-type: square;
       list-style-type: decimal;
       list-style-type: georgian;
       list-style-type: trad-chinese-informal;
       list-style-type: kannada;
      
       /* <string> value */
       list-style-type: '-';
      
       /* Identifier matching an @counter-style rule */
       list-style-type: custom-counter-style;
      
       /* Keyword value */
       list-style-type: none;
      
       /* Global values */
       list-style-type: inherit;
       list-style-type: initial;
       list-style-type: revert;
       list-style-type: revert-layer;
       list-style-type: unset;
      
       list-style-type: custom name example defined in @counter-style shown below;
      
       @counter-style thumbs {
             system: cyclic;
             symbols: "\1F44D";
             suffix: " ";
           }
      
           ul {
             list-style: thumbs;
           }
      
      
  2. Ordered Lists
    • When should you use an ordered list vs an unorder list in your HTML document?
      • When the order matters:
        • Steps in a recipe
        • Turn-by-turn directions
        • The list of ingredients in decreasing proportion on nutrition information labels
        <ol>
          <li>Fee</li>
          <li>Fi</li>
          <li>Fo</li>
          <li>Fum</li>
        </ol>
        
        
    • Describe two ways you can change the numbers on list items provided by an ordered list?
      • type Sets the numbering type. Example <ol type="i">
        • a for lowercase letters
        • A for uppercase letters
        • i for lowercase Roman numerals
        • I for uppercase Roman numerals
        • 1 for numbers (default)

      Note: Unless the type of the list number matters (like legal or technical documents where items are referenced by their number/letter), use the CSS list-style-type property instead.

Learn CSS

Learn JS

Back to Top