Dr. Greg Bernstein
Updated February 5th, 2021
<img>
and <figure>
elements, especially image sizesHTML Character Entities, escaping, Unicode and such
<
,>
, and special characters?From MDN Entity
HTML reserves four characters for its syntax:
&
: the ampersand
<
: the less-than sign
<
,>
, and special characters?From MDN Entity
HTML reserves four characters for its syntax:
>
: the greater-than sign
"
: the straight double-quote character
&stuff;
We can get <
, >
, &
, and "
with the character entities <
, >
, &
, and "
However there are a bunch more officially available. I like: ©, ℏ, ℝ —, –
What do you should do about the HTML reserved characters when you write Markdown?
from Wikipedia Unicode
“Unicode is a computing industry standard for the consistent encoding, representation, and handling of text expressed in most of the world’s writing systems.”
“Web browsers have supported Unicode, especially UTF-8, for many years.”
→ We can use unicode characters in our pages!
☺
img
tag<img src="rel_or_abs_URL">
famous attributes: alt
, width
, height
img
alt
AttributeFrom MDN:
its value is supposed to be a textual description of the image, for use in situations where the image cannot be seen/displayed.
<img src="rel_or_abs_URL" alt="a nice short description">
img
width
& height
AttributesThese DO NOT resize the image, only hold a place holder for the image of the correct size if it can’t be downloaded.
I don’t use these. To scale images use CSS!
img
are by default inline content. You can change this with the CSS display
property.
How big are the JPG files generated by your phone?
Cell phone and any modern digital camera images are TOO BIG for web work, i.e., they contain too many pixels!
Rescale them to a smaller size, e.g., 1080px in width or height or less using a free program such as IrfanView, GIMP, ImageMagick.
figure
elementFrom MDN figure
The HTML <figure>
element represents self-contained content, frequently with a caption (<figcaption>
), and is typically referenced as a single unit.
figure
example<figure>
<img src="PattyWallabyScaled.jpg" class="Restricted"
alt="Scaled cellphone image sized with CSS">
<figcaption>A caption for the figure.
Styled with CSS.</figcaption>
</figure>
<dl>
<dt>HTTP</dt>
<dd>The Hypertext transfer protocol is an application
layer protocol.</dd>
<dt>TCP</dt>
<dd>The transport control protocol insures reliable delivery
of byte streams between endpoints.</dd>
<dt>Internet Protocol</dt>
<dd>The Internet Protocol (IP) provides the global addressing that
allows packetized information to be sent anywhere
in the world.</dd>
</dl>
<blockquote cite="https://www.nobelprize.org/nobel_prizes/physics/laureates/2011/">
The Nobel Prize in Physics 2011 was divided, one half awarded to Saul Perlmutter,
the other half jointly to Brian P. Schmidt and Adam G. Riess <em>"for the discovery
of the accelerating expansion of the Universe through observations of distant supernovae".</em>
</blockquote>
<p>The folks at Mozilla say that inline quotes are
<q>for short quotations that don't require
paragraph breaks.</q></p>
Like HTML!
<p>Computer and telecomnications networking is full of abbreviations.
I worked on standards for
<abbr title="Wavelength Switched Optical Networks">WSON</abbr>.
These are <abbr title="Wavelength Division Multiplexed">WDM</abbr>
networks featuring switches called
<abbr title="Reconfigurable Optical Add/Drop Multiplexers">ROADMs</abbr>.
</p>
<p>If you say the 7<sup>th</sup> of April you'll use a
superscript on the <q>th</q>. If you specify
the chemical formula for water, H<sub>2</sub>O you'll
use a subscript on the <q>2.</q></p>.
<details>
When can you leave out a semi-colon in JavaScript? The answer is quite involved so I just put one at the end of every statement rather than worry about …
<details>
See MDN details
<details>
<summary>A bunch of Details</summary>
<p>When can you leave out a semi-colon in JavaScript? The answer is quite involved so I just put one at the end of every statement rather than worry about ...</p>
</details>
From MDN:
<code>
: For marking up generic pieces of computer code.<pre>
: For marking up blocks of fixed width text, in which the whitespace is retained<var>
: For specifically marking up variable names.From MDN:
<kbd>
: For marking up keyboard (and other types of) input entered into the computer.<samp>
: For marking up the output of a computer program.In practice for blocks of code one uses <pre>
and <code>
and then a JavaScript based syntax highlighter.