K.GEOFFREYSOGAPhD
HTML CSS

| Home | html / css | Houdini Python
basic html
<!DOCTYPE html>
<html lang="en">
<head>
  <link rel="shortcut icon" href="/public_html/favicon.ico">
  <link href='style.css' rel='stylesheet'>
  <meta charset="utf-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <meta name="description" content="">
  <meta name="keywords" content="">
  <title></title>
</head>
<body>
</body>
</html>
          
basic css
:root {
	--cd-body: white;
}

* {
	margin: 0;
	padding: 0;
}

html {
	font-size: 100%;
}

body {
	background: var(--cd-body);
}

/* responsive menu break point, more or less */
@media screen and ( max-width:700px ) {
}

/* mobile break point, more or less */
@media screen and ( max-width:420px ) {
}
          
Font sizes and lengths
Absolute units
CSS understands common units of length, including inches (in) and centimetres (cm). The units of typography can also be used, including point (pt) and pica (pc). These are called absolute units, and can be used interchangeably.
The conversion for some absolute units: 1in = 2.54cm = 72pt = 6pc
Relative units

When you set the font size to, say, 12pt, what exactly is 12pts long?

There is a loosely defined concept of an em box, which is big enough to contain the capital "M" in that font. For a 12pt font, the em box has a side length equal to 12pt.

There is a related CSS size unit known as the em. The em is simply the current font size. Any length, including a new font size, can be set in em units, and therefore relative to the current font size. A similar, less common unit called the ex is equal to the height of the lower case "x" in the current font.

There is also a useful unit known as the rem. One rem is equal to the font size of the root element. Therefore, it is constant throughout the page. If all text has its size defined in rem, then it will all scale consistently if the font size of the root element is changed.

A special case: the px unit
CSS also has the px, or "pixel", unit. For print media, 1in equals 96px. For screen devices, from what I understand, the px is more qualitative - one px should be small but visible, and a line 1px wide should be displayed with sharp edges. Therefore, the px is not a constant length, but any element defined in px should appear the same on any output device.
Responsive units

Lengths can be specified in vw units. One vw is equal to one percent of the viewport width. Similarly, one vh is one percent of the viewport height. One vmin is the smaller of vw and vh, and vmax is the larger.

So any element defined in units of vw scales exactly as the viewport width changes. Such elements are necessarily responsive. A note of caution, however; webpages can look funny if they scale perfectly with the viewport. Often, the proportions need to change depending on the size of the viewport. These reponsive units should be used with more care than it might first appear.

basic CGI
This code goes into the body of an html file, say "form.html".
<form action="form.php" method="post">
input 1: <input type="text" name="one"><br>
input 2: <input type="text" name="two"><br>
<input type="submit">
</form>
          
Then this is the "form.php" file.
Form output<br/>
input 1 = <?php echo $_POST["one"] ?><br/>
input 2 = <?php echo $_POST["two"] ?>
          
If you use the "get" method, then the php hash is named "$_GET". And the rest is detail.