reading-notes

HTML Links, JS Functions, and Intro to CSS Layout

To create a basic link, you must wrap your text or content inside an <a> element.

The href Attribute

The href attribute (Hypertext Reference) contains the web address or target URL that the link points to. This URL can point to HTML files, images, videos, or any other resource on the web.

To make links accessible to all users, including those using screen readers or those who are skimming the page, follow these best practices:


CSS Layout: Normal Flow & Positioning

What is meant by “normal flow”?

Normal flow is the default system the browser uses to lay out block and inline elements on a webpage when no CSS has been applied. It ensures content is accessible and readable by default.

Differences Between Block-level and Inline Elements

Block-level Elements:

Default Positioning

Static positioning is the default for every HTML element. It places the element in its default position according to the normal document flow.

Advantages of Absolute Positioning

Absolute positioning removes an element from the normal flow, allowing it to sit on its own separate layer.

Key Difference: Fixed vs. Absolute Positioning

  1. Both remove elements from the normal flow, but their context differs:

Functions – Reusable Blocks of Code

Function Declaration vs. Invocation

Function Declaration: Defining and storing code using the function keyword. These are hoisted, meaning they can be called before they are defined in the script.

Function Invocation: Executing the code. You must include the name followed by parentheses, e.g., draw();.

Parameter vs. Argument

Parameters: Variables defined in the declaration. They act as placeholders.

Arguments: The actual values passed into the function when it is called. Multiple arguments are separated by commas.


6 Reasons for Pair Programming

2 Benefits to Pair Programming

Greater Efficiency and Higher Code Quality

Reflection: Having a Navigator to scan for typos and think big-picture while a Driver writes code prevents getting stuck for hours on minor syntax errors, boosting overall confidence.

Learning from Fellow Students

Reflection: This transforms coding into a collaborative experience involving listening, speaking, reading, and writing, which prepares you for the professional communication demands of a dev job.