Posted on: Apr 18, 2023
Stripped-down, bare-bone examples demonstrating various HTML elements and CSS properties.
See them in action and tinker — play with the code and watch what happens.
Text
- Headings:
h1
to h6
in their default style.
- Size doesn’t matter: Making headings any size you choose with CSS.
- Bold, italics, case, and line height: Using
font-weight
, font-style
, font-variant
, text-transform
, and line-height
.
- Font families: Font family lists and the generic fallback font families.
- Font sizes: Absolute and relative units.
- Spacing out text:
text-align
, text-indent
, word-spacing
, and letter-spacing
properties.
- Vertical alignment: The
vertical-align
property.
- Subscript and superscript: Using positioning as an alternative to the
vertical-align
property.
- Text shadows: Shadows. On text.
- Simple drop caps: A simple way to achieve a common effect.
- Fancy drop caps: Jazzing up that first letter.
- Graphical drop caps: Using images.
- First-paragraph drop caps: Targeting the first letter of the first paragraph.
- Pull quotes 1: A simple pull quote structure.
- Pull quotes 2: Adding a bit of style.
- Pull quotes 3: A more elaborate style.
Links
Colors, Images, and Backgrounds
Layout
- Widths and heights:
width
, height
, max-width
, min-height
, and so on.
- Borders: Thick, thin, this color, that color, solid, dotted, dashed…
- Rounded corners: Using the
border-radius
property.
- Box shadows: Adding pop.
- Margin collapsing: How vertical margins merge, or “collapse”, into each other.
- Outlines: The “borders” that border borders.
- Overflow: Managing the portions of content that do not fit inside a box.
- Block and inline 1: Changing the behavior of boxes using the
display
property.
- Block and inline 2: More differences between block and inline boxes.
- Block and inline 3: Applying
display: inline-block
.
- Positioning: static: Following the normal flow.
- Positioning: relative: Offsetting from the box’s initial position.
- Positioning: absolute 1: Positioning in relation to a box’s container.
- Positioning: absolute 2: Inside a positioned box.
- Positioning: fixed: In relation to the viewport.
- Z-index: Stacking positioned boxes.
- Floating 1: A simple floated box.
- Floating 2: Two floated boxes.
- Floating 3: Clearing floated boxes.
- Page layout 1: Two columns step 1: positioning a navigation column.
- Page layout 2: Two columns step 2: using
margin
to push the content out from under the navigation column.
- Page layout 3: Using a border to provide the background for a column.
- Page layout 4: Three columns.
- Page layout 5: Adding a header.
- Page layout 6: Footers won’t always work with absolute positioned columns…
- Page layout 7: Adding a footer using floated columns.
- Charles Darwin: A styled up version of the basic principles of previous examples.
- 2D Transforms: Manipulating the size, shape, and position of boxes with the
transform
property.
- Transform origin: Altering the point at which transformations are measured from.
Lists & Navigation
Tables
From: https://www.htmldog.com/
Code
Art
Design
UI/UX
Video
Projects
Social