This topic matters because…
It’s important to know which file to use for different use case scenarios to draw out the best possible resoultion or compatability. When linking images, as basic as it may seem, it’s important to know the syntax to use, lest the links should break, and best practices. Images, as well as font styling, both play a big role into making pages pop and stand out amongst each other.
Houses links for tutorials and other challenges.
Images are added by using the <img> element, specify the source (whether local path or url) with the src attribute, and at minimum, adding descriptive alternative text through the alt attribute. <img> elements do not have a closing tag (void element, <a>, etc.).
<img src="______" alt="____" />
Adding images through the use of an embedded url can be risky at the potential of links breaking, as such it is recommended to host images yourself.
Various license exist and pertain to using images hosted on other websites, such as:
Understanding these licenses is vital to be sure you are permitted to use the image.
The <figure> element and accompanying <figcaption> element bridge the gap and help (scorereaders or other accessibility tools) link descriptive text to images, audio, code, video, etc.
Images can also be linked by using CSS (background-image property and the like) as well.
Most commonly used on the web are as follows:
.apng .png..avif..gif.jpg, .jpeg, .jfif, .pjpeg, .pjp..png.svg..webp.Bitmap file (.bmp), microsoft icon (.ico / .cur), tagged image file format (.tif / .tiff) are also other file formats, albeit less used dude to being less supported across different browsers.
bpc, or bits per component = how color components are represented by bits.
bit depth = how each pixel is represented in memory by total number of bits.
APNG - extends on PNG to add support for animation; very similar to GIF, but with better support for various color depths; lossless compression; CC-BY-SA 3.0 license.
AVIF - AV1 bitstreams wrapped in HEIF; lossy compared to JPG/PNG, at similar compression, and better compression than WebP; offers lossless, alpha channel, HDR, and wide color Gamut; Royalty free.h
BMP - seen more on windows and rarely in web apps /content; supports several compression algos; microsoft open specification promise.
GIF - one of two to be supported by HTM; losslessly compresses 8-bit indexed color graphics; popular, although inferior to PNG/APNG; Open, LZW expired patent.
ICO - for microsoft desktop icons, designed by Microsoft; can store multiple images/icon; pairs nicely with BMP (rather than PNG or others); no licensing??
JPEG - lossy; most widely used format; actually JFIF (JPEG File Interchange Format); expired patents.
PNG - lossless; higher efficiency and color depths than GIF; W3C, all Rights Reserved.
SVG - specifies image content by drawing shapes, lines, and adding colors, etc. W3C, All Rights Reserved
TIFF - for scanned photos/files, (can be multiple per file); weaker compression, includes plenty metadata; not supported my majority of browser’s; No licensing required, no patents, check with libraries being used.
WebP - lossy and lossless compression; supports animation(s); modern support, but not historical, provide fallback (JPEG/PNG); Open spurce, no licensing.
XBM - another first to be supported on the web; deprecated, should be avoided for secuiryt concerns; open source.
Photos - pair well with lossy compression; JPEG offering better compatibility, but better compression through WebP. Standard practice to use both and use JPEG as the fallback.
Icons - lossless to avoid skimping on details from size; PNG better choice, although can be used as fallback if want to go WebP route.
Screenshot - lossless; PNG, but can be WebP as well.
Diagrams, drawing, charts, etc. - lossless; should be SVG or PNG at minimum.
<picture> provides opportunity to supply fallbacks, whereas <img> does not. <picture> is the parent element and <source> is the actual element that links to the image (with the srcset attribute).
<figure> and <figcaption> to properly link image and text.<figure> element would be useful in an HTML document.
Landing page for tutorials and challenges.
Keep in mind contrast and user legibility and experience when choosing color(s).
Every element in HTML can have color applied to it. Through CSS properties, the developer is given more granular control over how color is added.
The two main properties used to style content with CSS are,
font-family is the property and for the value, either a browser-built in one or an embedded one that was linked in the html file’s <head> tag.
Hundred of additional elements, properties, and values exist.