You should use an unordered list (ul) in your HTML document when you want to create a list of items that are not inherently ordered or ranked. Unordered lists are typically used for items that have no particular sequence or importance, and they are displayed with bullet points. Changing the Bullet Style of Unordered List Items:
You can change the bullet style of unordered list items using CSS. To do this, you can use the list-style-type property. For example:
//This will change the bullet style to circles. Other values for list-style-type include ‘disc,’ ‘square,’ and ‘none’ among others.
When to Use Ordered Lists vs. Unordered Lists:
Use an ordered list (ol) when you want to create a list of items that have a specific sequence or ranking. Ordered lists are used when the order of items matters, and they are displayed with numbers by default. Unordered lists are used when the order doesn’t matter, and they are displayed with bullet points. Two Ways to Change Numbers on Ordered List Items:
You can change the numbers on list items provided by an ordered list using CSS. Two common ways to do this are:
<ol> element to specify the starting number for the list.In the story titled “The Box Model,” the CSS properties of margin and padding are portrayed as characters with distinct roles:
Margin (Mr. Margin): Mr. Margin decides how far apart the element should be from other elements. If there are multiple elements (characters) on a stage (webpage), Mr. Margin ensures they maintain a comfortable distance, preventing them from getting too close to one another.
Padding (Ms. Padding): Patty Paddington is responsible for the internal spacing within the element. She ensures that the content (the character’s ) inside the element has enough space to breathe. Patty adds space inside the element to keep the content away from the edges.
You can learn more about the CSS Box Model here.
Four Parts of an HTML Element’s Box (Box Model):
Learn JavaScript: Arrays, Operators, Expressions, Conditionals, Loops
Data Types in Arrays: Arrays in JavaScript can store various data types, including numbers, strings, objects, other arrays, functions, and even a mix of these types. People Array:
The people array is a valid JavaScript array. To access values stored in the array, for example: javascript
const name = people[0][0]; // ‘pete’ const age = people[0][1]; // 32 Five Shorthand Operators for Assignment in JavaScript:
+=: Adds the right operand to the left operand and assigns the result to the left operand (e.g., x += 5 is equivalent to x = x + 5). -=: Subtracts the right operand from the left operand and assigns the result to the left operand. *=: Multiplies the left operand by the right operand and assigns the result to the left operand. /=: Divides the left operand by the right operand and assigns the result to the left operand. %=: Calculates the remainder when the left operand is divided by the right operand and assigns the result to the left operand.
let a = 10;
let b = 'dog';
let c = false;
// evaluate this
(a + c) + b;
In this expression, (a + c) is evaluated first, resulting in a number (10 + 0 = 10). Then, 10 + b is evaluated, which results in a string concatenation, so the final result would be the string ‘10dog’.
Use of a Loop in JavaScript:
How to do order and unorder list on another language.
learn about advanced padding and margin
10/24/2023