View on GitHub

reading-notes

Reading Notes about Markdown-Html-Css-JavaScript

HTML Links - Hyperlinks

link HTML links are hyperlinks.

You can click on a link and jump to another document.

When you move the mouse over a link, the mouse arrow will turn into a little hand.

Note: A link does not have to be text. A link can be an image or any other HTML element!

HTML Links - Syntax

The HTML < a> tag defines a hyperlink. It has the following syntax:

<a href="url">link text</a>

The target attribute can have one of the following values:

<style>
a:link {
  color: green;
  background-color: transparent;
  text-decoration: none;
}

a:visited {
  color: pink;
  background-color: transparent;
  text-decoration: none;
}

a:hover {
  color: red;
  background-color: transparent;
  text-decoration: underline;
}

a:active {
  color: yellow;
  background-color: transparent;
  text-decoration: underline;
}
</style>

Use mailto: inside the href attribute to create a link that opens the user’s email program (to let them send a new email):

Example

<a href="mailto:someone@example.com">Send email</a>

HTML Layout Elements

CSS Flexbox Layout

Use of flexbox ensures that elements behave predictably when the page layout must accommodate different screen sizes and different display devices.

The position Property The position property specifies the type of positioning method used for an element.

There are five different position values:


## Position

Gives strict, coordinate-based control over layout.

2


JavaScript Functions

JavaScript Function Syntax A JavaScript function is defined with the function keyword, followed by a name, followed by parentheses ().

Function names can contain letters, digits, underscores, and dollar signs (same rules as variables).

The parentheses may include parameter names separated by commas: (parameter1, parameter2, …)

The code to be executed, by the function, is placed inside curly brackets: {}

function name(parameter1, parameter2, parameter3) {
  // code to be executed
}

JavaScript Function Syntax A JavaScript function is defined with the function keyword, followed by a name, followed by parentheses ().

Function names can contain letters, digits, underscores, and dollar signs (same rules as variables).

The parentheses may include parameter names separated by commas: (parameter1, parameter2, …)

The code to be executed, by the function, is placed inside curly brackets: {}

function name(parameter1, parameter2, parameter3) {
  // code to be executed
}

JavaScript Date Objects

JavaScript Date Output

By default, JavaScript will use the browser’s time zone and display a date as a full text string:

Sun Feb 14 2021 02:39:37 GMT-0800 (Pacific Standard Time) .

There are 4 ways to create a new date object:

1-new Date()

2- new Date(year, month, day, hours, minutes, seconds, milliseconds)

3- new Date(milliseconds)

4- new Date(date string)

5- new Date()

6- new Date() creates a new date object with the current date and time:

new Date(year, month, …) new Date(year, month, …) creates a new date object with a specified date and time.