reading-notes

View the Project on GitHub Abu-laban/reading-notes

HTML Links, JS Functions, and Intro to CSS Layout

Links are the defining feature of the web because they allow you to move from one web page to another β€” enabling the very idea of browsing or surfing.

You will commonly come across the following types of links:

Links are created using the <a> element. The <a> element uses the href attribute to indicate the page you are linking to.

If you are linking to a page within your own site, it is best to use relative links rather than qualified URLs.

You can create links to open email programs with an email address in the β€œto” field.

You can use the id attribute to target elements within a page that can be linked to.

CSS Layout

CSS provides several layout options that allow us to control the position of HTML elements as compared to their default position that would appear in a normal layout.

Various Layout Techniques

The following layout techniques:

  1. Normal layout
  2. CSS display property
  3. Flexbox
  4. Floats
  5. Grid layout
  6. Positioning elements
  7. The Table layout
  8. Multi-column layout

A single webpage may either contain only 1 layout from the above options or multiple layout options integrated and style together to achieve the required structure of the webpage.

<div> elements are often used as containing elements to group together sections of a page.

Browsers display pages in normal flow unless you specify relative, absolute, or fixed positioning.

The float property moves content to the left or right of the page and can be used to create multi-column layouts. (Floated items require a defined width.)

Grids help create professional and flexible designs.

CSS Frameworks provide rules for common tasks.

You can include multiple CSS files in one page.

JS Functions

WHAT IS A FUNCTION?

Functions let you group a series of statements together to perform a specific task. If different parts of a script repeat the same task, you can reuse the function (rather than repeating the same set of st atements).

function

Defining functions

example

Calling functions

Defining a function does not execute it. Defining it names the function and specifies what to do when the function is called.

Calling the function actually performs the specified actions with the indicated parameters.

call


ex