Web-Dev

HTML

input element attributes: min=“0” max=“10” step=“0.01”

If you don’t specify the step as <1, then floats will be flagged as invalid.

Classes

<article class="class1 class2">
<tag class="group" id="uniq"> </tag>

Forms

The below send the input to http://localhost:3000/search?q=…

<form action="http://localhost:3000/search" method="get">
    <input type="text" name="q" placeholder="Search..."/>
</form>

CSS

CSS can be added to HTML documents in 3 ways:

rem is a multiple of the default root font-size. 1rem = 16px (default, but can be changed) Prefer using rem units as much as possible.

h1 {}
.class {}
#id {}

Variables

CSS variables can have a global or local scope. Global variables can be accessed/used through the entire document, while local variables can be used only inside the selector where it is declared. To create a variable with global scope, declare it inside the :root selector. The :root selector matches the document’s root element. To create a variable with local scope, declare it inside the selector that is going to use it.

:root {
  --blue: #6495ed;
  --white: #faf0e6;
  --font-serif: Georgia, serif;
}

.container {
  color: var(--blue);
  background-color: var(--white);
  padding: 15px;
}

The root element can be accessed using document.documentElement.

Styling

Tables

table {
    border-collapse: collapse; // no borders
}

Performance

Repaint: occurs when changes are made to elements that affect visibility but not the layout. Example: opacity, background-color, visibility, and outline. Repaints are expensive because the browser must check the visibility of all other nodes in the DOM — one or more may have become visible beneath the changed element.

Reflows: refers to the re-calculation of positions and dimensions of all elements, which leads to re-rendering part or all of the document. Changing a single element can affect all children, ancestors, and siblings. Have a bigger impact than repaints.

Triggered when

Both are browser-blocking; neither the user or your application can perform other tasks during the time that a repaint or reflow occurring. In extreme cases, a CSS effect could lead to slower JavaScript execution. This is one of the reasons you encounter issues such as jerky scrolling and unresponsive interfaces.

https://www.sitepoint.com/10-ways-minimize-reflows-improve-performance/

HTTP

Methods

Less common

Status codes

The status code informs the client of the status of the HTTP server’s response. In HTTP/1.1, 5 kinds of status codes were defined:

URLs

http://www.example.com/index.html, which indicates a protocol (http), a hostname (www.example.com), and a file name (index.html).

scheme :// host : port : pa/th ? query # fragment

Monitoring/Logging

Four golden signals or RED

References