HTML TEMPLATE

Lotus Flower

This is the last time I am re-writing these freaking web pages! I am not kidding. THIS IS THE LAST TIME! @#%^&*! It started with Wordpress and the Typo theme. Then self hosted on a Raspberry pi zero with my [dumpster fire] style.css. Then used Joel Dare's neat.css. Now I'm in the middle of a Zen CSS renaissance. I know what you're thinking. This is not the last time. Bah.

A few words about Zen CSS. Choose a minimalist approach.

Center

The center class can be specified for paragraph or anything that needs to be centered

dave@worldsworstwriter.org 2024-12-27

<p class="center">dave@worldsworstwriter.org 2024-12-27</p>

Color Scheme Light and Dark

A light and dark color scheme will display depending on the operating system settings. If the OS is set to dark then a dark scheme is displayed. If the OS is set to light, a light scheme is displayed. If the OS is set to auto, the color scheme will change depending on the OS. Usually a light scheme during the day and dark scheme at night. Here is the CSS:

:root {
  color-scheme: light dark;
  --light-color: #004040;
  --light-bg: snow;
  --dark-color: #e0e0e0;
  --dark-bg: #364e4f;
  --highlight-color: black;
  --highlight-bg: gainsboro;
  --highdark-color: #e0e0e0;
  --highdark-bg: #4b6c6d;
  --buttonlight-color: black;
  --buttonlight-bg: gainsboro;
  --buttondark-color: snow;
  --buttondark-bg: #343434;
}

* {
  background-color: light-dark(var(--light-bg), var(--dark-bg));
  color: light-dark(var(--light-color), var(--dark-color));
}

Light Color Scheme

This is an example of a light color scheme.

Highlighted text


Dark Color Scheme

This is an example of a dark color scheme.

Highlighted text


CSS File

The power of the template is to edit one css file instead of 70. Copy the template to fast start a new page. Embedded text file objects spare another edit when the text file changes. Inline styles provide a way to override the template. And separate CSS files [gasp] are available for things like web apps or when the template is a poor fit. Here is the line to include a central CSS file.

<link rel="stylesheet" href="../css/style.css">

No Support?

Heading

The title of the page uses the <h1> tag. It is centered and capitalized. Subtitles use <h2>, <h3>, and <h4> and are left justified for readability. Subtitles are not capitalized.

HEADING H1

Heading H2

Heading H3

Heading H4

<h1>HEADING H1</h1>
<h2>Heading H2</h2>
<h3>Heading H3</h3>
<h4>Heading H4</h4>

Highlight

The highlight class adds a highlighted background to paragraph text and is indented. Good for quotes, or text blocks.

<p class="highlight">The highlight class adds a highlighted background color to paragraph text. Good for quotes, or text blocks.</p>

Images

Images default to 100% width [shown in the banner image]. Loading is set to lazy. The image width can be overridden with an inline style and are centered with auto margins.

Lotus Flower
Lotus Flowers
<img src="lotus.jpg" style="width:50%;" alt="lotus flower">

Image captions are done with <figcaption>. The figcaption CSS is tricky. If the image width is overridden, the figcaption width must be overridden.

<figure>
<img src="lotus.jpg" style="width:50%;" alt="Lotus Flower">
<figcaption style="width:50%;">Lotus Flowers</figcaption>
</figure>

Javascript

There is no need for javascript, server backends, advertising, subscriptions, pop ups, paywalls, or malware on a static web page. Be kind to your readers [and everyone else].

List

Objects

HTML objects are a good way to embed text files into an HTML document. Here is an example.


No Support?

NOTE: Wrap the object tags in a <pre> tag so the object will refresh when the text file is changed and so long text lines can be scrolled. Here is the code.

<pre>
<object data="example.txt" type="text/plain" width="600" height="1400">
<a href="example.txt">No Support?</a>
</object>
</pre>

Paragraph

There are 4 major decisions to make with paragraph. The font typeface, size, line height, and justification define the look of the web page. If the font and size are not specified, the browser uses the defaults. Usually Times New Roman @ 16px. This is a difficult decision and highly subjective. The reader can adjust the font size in the browser.

<p>There are major decisions to make with paragraph.</p>
font-family: "helvetica neue", helvetica, arial, sans-serif;
font-size: 1em;
line-height: 1.375em;
text-justify: none;

This font is Sans-serif. abcdefg ABCDEFG 12345
This font is Times New Roman. abcdefg ABCDEFG 12345
This font is Arial. abcdefg ABCDEFG 12345
This font is Helvetica. abcdefg
This font is Helvetica Neue. abcdefg ABCDEFG 12345
This font is Verdana. abcdefg ABCDEFG 12345
This font is Monospace/Courier. abcdefg ABCDEFG 12345
This font is Courier New. abcdefg ABCDEFG 12345

One more paragraph consideration is text justification. Justification looks nice. No justification is easier to read. Some will prefer justification. Some will not prefer justification. Justification is highly subjective. This paragraph is not justified.

One more paragraph consideration is text justification. Justification looks nice. No justification is easier to read. Some will prefer justification. Some will not prefer justification. Justification is highly subjective. This paragraph is justified.

Preformat

The preformatted <pre> tags are highlighted blocks of monospaced font to display code or quotes. The text is indented and long lines can be scrolled.

<p>The preformatted <pre> tags are highlighted blocks of monospaced font to display code.</pre>

Syntax Highlighting

HTML and Javascript source code can be displayed with color coded syntax highlighting. This web site HTML Escape can take HTML markup or Javascript code and generate escaped markup/code that can be displayed on a web page. Paste the markup/code into the HTML Markup window and click the HTML Escape button. Here is an example.

<figure>
<video class="center" width="50%" controls poster="w93hstop.png" preload="none">
<source src="w93hstop.mp4" type="video/mp4">
Your browser does not support the video tag.
</video>
<figcaption style="width:50%">Casio W93H-1AV Stopwatch Countdown Timer</figcaption>
</figure>

<pre>
&lt;span style="color:dodgerblue"&gt;
&lt;span style="color:dodgerblue"&gt;&lt;
&lt;/span&gt;figure
&lt;span style="color:dodgerblue"&gt;&gt;
&lt;/span&gt;
&lt;/span&gt;
&lt;br&gt;
&lt;span style="color:dodgerblue"&gt;
&lt;span style="color:dodgerblue"&gt;
&lt;&lt;/span&gt;video
&lt;span style="color:red"&gt; class
&lt;span style="color:seagreen"&gt;="center"
&lt;/span&gt; width
&lt;span style="color:seagreen"&gt;="50%"
&lt;/span&gt; controls poster
&lt;span style="color:seagreen"&gt;="w93hstop.png"
&lt;/span&gt; preload
&lt;span style="color:seagreen"&gt;="none"
&lt;/span&gt;
&lt;/span&gt;
&lt;span style="color:dodgerblue"&gt;&gt;
&lt;/span&gt;
&lt;/span&gt;
&lt;br&gt;  
&lt;span style="color:dodgerblue"&gt;
&lt;span style="color:dodgerblue"&gt;
&lt;&lt;/span&gt;source
&lt;span style="color:red"&gt; src
&lt;span style="color:seagreen"&gt;="w93hstop.mp4"
&lt;/span&gt; type
&lt;span style="color:seagreen"&gt;="video/mp4"
&lt;/span&gt;
&lt;/span&gt;
&lt;span style="color:dodgerblue"&gt;&gt;
&lt;/span&gt;
&lt;/span&gt;
&lt;br&gt;Your browser does not support the video tag.
&lt;br&gt;
&lt;span style="color:dodgerblue"&gt;
&lt;span style="color:dodgerblue"&gt;
&lt;&lt;/span&gt;/video
&lt;span style="color:dodgerblue"&gt;&gt;
&lt;/span&gt;
&lt;/span&gt;
&lt;br&gt;
&lt;span style="color:dodgerblue"&gt;
&lt;span style="color:dodgerblue"&gt;
&lt;&lt;/span&gt;figcaption
&lt;span style="color:red"&gt; style
&lt;span style="color:seagreen"&gt;="width:50%"
&lt;/span&gt;
&lt;/span&gt;
&lt;span style="color:dodgerblue"&gt;&gt;
&lt;/span&gt;
&lt;/span&gt;Casio W93H-1AV Stopwatch Countdown Timer
&lt;span style="color:dodgerblue"&gt;
&lt;span style="color:dodgerblue"&gt;
&lt;&lt;/span&gt;/figcaption
&lt;span style="color:dodgerblue"&gt;&gt;
&lt;/span&gt;
&lt;/span&gt;
&lt;br&gt;
&lt;span style="color:dodgerblue"&gt;
&lt;span style="color:dodgerblue"&gt;
&lt;&lt;/span&gt;/figure
&lt;span style="color:dodgerblue"&gt;&gt;
&lt;/span&gt;
&lt;/span&gt;
<pre> 

Table

Various Barometric Units
UnitLowNormalHigh
atm.98911.0093
inHg29.629.9230.2
mmHg751.84759.96767.08
mbar1002.371013.251022.68
psi14.5314.6914.83
<table>
<caption>Various Barometric Units</caption>
<tr><th>Unit</th><th>Low</th><th>Normal</th><th>High</th></tr>
<tr><td>atm</td><td>.989</td><td>1</td><td>1.0093</td></tr>
<tr><td>inHg</td><td>29.6</td><td>29.92</td><td>30.2</td></tr>
<tr><td>mmHg</td><td>751.84</td><td>759.96</td><td>767.08</td></tr>
<tr><td>mbar</td><td>1002.37</td><td>1013.25</td><td>1022.68</td></tr>
<tr><td>psi</td><td>14.53</td><td>14.69</td><td>14.83</td></tr>
</table>

Video

Use the video tag to embed video content. The poster image is displayed when the video is not playing. Preload none stops the video from loading when the page is loaded.

Casio W93H-1AV Stopwatch Countdown Timer
<figure>
<video class="center" width="50%" controls poster="w93hstop.png" preload="none">
<source src="w93hstop.mp4" type="video/mp4">
Your browser does not support the video tag.
</video>
<figcaption style="width:50%">Casio W93H-1AV Stopwatch Olympic Style Countdown 
Timer</figcaption>
</figure>

dave@worldsworstwriter.org 2024-10-06