<!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>
: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 ) {
}
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.
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.
<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>
Form output<br/>
input 1 = <?php echo $_POST["one"] ?><br/>
input 2 = <?php echo $_POST["two"] ?>