Article Example
Published:
This is an example of an article with proper semantic structure. Articles can contain their own headers, footers, and sections.
This page demonstrates the power of modern HTML and CSS with minimal JavaScript support. From interactive elements to advanced styling, discover what's possible with modern web standards in 2025.
Modern HTML provides a rich set of semantic elements that give meaning to your content and improve accessibility, SEO, and maintainability.
Published:
This is an example of an article with proper semantic structure. Articles can contain their own headers, footers, and sections.
HTML provides various elements for text formatting without requiring CSS or JavaScript.
<strong>
<em>
<u>
<s>
<mark>
<small>
<sub>
<sup>
漢字 - Ruby annotations for East Asian typography
Text direction: This text will go right to left
Defining terms: HTML is the standard markup language for documents designed to be displayed in a web browser.
Variable: The equation is x = y + 2
Sample output: Hello, World!
Use <code>
for inline code like const x = 5;
and <kbd> for keyboard inputs like Ctrl + S.
// This is a code block with syntax highlighting-like styling
function greet() {
return "Hello, world!";
}
The World Wide Web Consortium (W3C) is an international community where Member organizations, a full-time staff, and the public work together to develop Web standards.
The HTML
<blockquote>
Element (or HTML Block Quotation Element) indicates that the enclosed text is an extended quotation.
HTML and CSS are the building blocks of the web. W3C maintains these standards.
HTML (HyperText Markup Language) is the standard markup language for documents designed to be displayed in a web browser.
CSS (Cascading Style Sheets) is a style sheet language used for describing the presentation of a document written in HTML.
Modern HTML includes several interactive elements that don't require JavaScript.
The <details>
and <summary>
elements provide
native HTML support for expandable content without requiring JavaScript.
This is a native popover element, new in HTML as of 2024.
HTML forms have evolved significantly, offering rich validation and input types without JavaScript.
Modern HTML provides powerful built-in validation capabilities:
The template above is not rendered but can be used as a blueprint for dynamic content. In a real application, JavaScript would clone and populate this template.
Modern HTML provides numerous features to improve accessibility without requiring JavaScript.
A skip navigation link (usually the first focusable element on a page) allows keyboard users to bypass navigation menus:
A skip link has been added at the top of the page. Press Tab when the page loads to see it appear.
Modern CSS provides powerful animation capabilities without requiring JavaScript.
Modern HTML and CSS provide powerful tools for creating responsive designs without JavaScript.
This paragraph also uses clamp() to ensure the text is readable on all devices without requiring media queries.
Resize this container to see the cards reflow
Modern CSS provides powerful layout capabilities without requiring JavaScript.
Subgrid allows nested grids to inherit the track sizing of their parent grid, enabling complex layouts with perfect alignment.
This is a multi-column layout that automatically balances the content between columns. It's perfect for text-heavy content like articles or blog posts.
The content flows naturally from one column to the next, creating a newspaper-like reading experience that works well on larger screens.
On smaller screens, the number of columns will automatically reduce to ensure readability is maintained without requiring JavaScript.
You can also control the width of columns instead of the count, allowing for more responsive designs.
Scroll Snap provides a way to create smooth, controlled scrolling experiences without JavaScript.
Scroll horizontally to see the next slide. The scroll will snap to each slide.
Notice how the scrolling snaps to the beginning of each slide.
This creates a carousel-like effect without any JavaScript.
CSS has evolved with powerful new selectors that make complex styling possible without JavaScript.
The :has() selector allows you to select elements based on their children or descendants - a "parent selector" that was long requested.
This card contains an image.
This card does not contain an image.
This card also contains an image.
These selectors help simplify complex selector lists and control specificity.
This paragraph is inside a header.
This paragraph is inside an article.
This paragraph is inside a div inside an article.
This selector applies styles only when the focus is from keyboard navigation, improving the user experience.
Logical properties and values provide a way to control layout through logical, rather than physical, direction and dimension mappings.
Using left, right, top, bottom
Using inline-start, inline-end, block-start, block-end
Same logical properties, different direction
Modern CSS makes it easy to implement dark mode without JavaScript using CSS custom properties and media queries.
This demo shows how to implement a theme toggle without JavaScript.
This card automatically adapts to the selected theme. All colors are controlled by CSS variables.
The checkbox state is used to toggle a class on the parent container, which changes the CSS variables.
:root { --bg-color: white; --text-color: black; }
.dark-theme { --bg-color: #222; --text-color: white; }
CSS media queries allow you to create print-friendly versions of your web pages without JavaScript.
This section demonstrates how to optimize content for printing using CSS media queries.
This is an example article that will look different when printed. When you print this page, you'll notice:
This example link will show its URL when printed.
Tables are specially formatted for printing to ensure readability.
Feature | Screen Display | Print Display |
---|---|---|
Colors | Full color palette | Optimized for black & white |
Navigation | Visible | Hidden |
Links | Clickable text | Text with URL |
Images | As designed | Optimized resolution |
Backgrounds | As designed | Removed to save ink |
These features demonstrate the power of modern web standards with minimal JavaScript support.
Share content using the device's native sharing capabilities:
Note: Web Share API requires HTTPS and is supported in most modern browsers.
const greeting = "Hello, HTML!";
Improve page performance with the loading="lazy" attribute:
The lazy loaded image will only load when it comes into the viewport, saving bandwidth.
Link directly to specific text on a page:
This is a paragraph with some highlighted text that can be linked to directly using text fragments.
Jump to Highlighted TextNote: Text fragments require HTTPS and are supported in Chromium-based browsers.
Scroll horizontally or use the navigation buttons below.
Notice how the scrolling snaps to each slide.
The buttons below enhance the native scroll snap behavior.
This container's colors are controlled by CSS custom properties (variables).
Use the controls below to change the colors: