HTML provides several types of lists to structure data, each serving unique purposes in document formatting.
Ordered Lists: Utilize the <ol> tag to initiate an ordered list where items are automatically numbered. Each item within the list should be wrapped in an <li> tag.
Unordered Lists: For lists that require bullet points instead of numbers, use the <ul> tag. Items within these lists are also placed within <li> tags.
Definition Lists: These lists are great for presenting terms and their definitions. They start with a <dl> tag, followed by <dt> for the term and <dd> for its definition.
Nested lists are possible by placing a new list (either <ol>, <ul>, or <dl>) inside an <li> tag of an existing list. This technique is useful for creating sublists within main list items.
Font Size Customization in CSS
CSS allows detailed control over the text appearance, including its size:
Pixels (px): Offers precise control over font size. Defining size in pixels specifies exactly how tall the text should be.
Percentages (%): Sets the font size relative to the parent element's font size. For example, 75% of 16px (common browser default) would be 12px.
Ems: Similar to percentages, ems are based on the font size of the parent element. They provide scalability and are especially useful for responsive design.
Text Styling in CSS
CSS provides numerous properties to style and align text:
Transform: Change case using text-transform with values like uppercase, lowercase, and capitalize.
Decoration: text-decoration can underline, overline, or strike through text. The less commonly used blink causes text to blink but is generally discouraged due to accessibility concerns. Alignment: Text can be aligned to the left, right, center, or justified with text-align. Vertical alignment is also possible with vertical-align.