import { html, htmlToResponse } from "@mastrojs/mastro"; import { Layout } from "../components/Layout.ts"; export const GET = () => htmlToResponse( Layout({ title: "Home", children: html`
Let's go through the most important HTML elements to structure your content:
The p element marks a paragraph of text.
At the very top of the body, we have the heading of this page in an h1 element. This is what search engines (like Google) and screen readers (used by visually impaired readers) look for when they want to know what the page's title is. Therefore, you should only ever have one h1 element on any given page.
The h2 element is a sub-heading. HTML has h1 up to h6 elements, to mark progressively deeper nested sub-headings. You should use those to mark the structure of your page. All headings together should act like a table of contents for your page.
Let's add an ordered list (meaning the list markers will be numbers):
and an unordered list (the list markers will be bullet points):
Note how all elements introduced so far cause a line-break before and after them? That's because they are so-called block elements.
However, links (like the a element we just saw), emphasis (rendered as italics), and strong emphasis (rendered bold), are all inline elements. That means they don't cause any line-breaks by default.
We will add an image file chair.jpg later.
For now, note the alt attribute on the image. It is required and contains "alternative text" that is read to visually impaired readers, or shown if the image fails to load.
If the image is relevant content, the alt text should therefore be a brief description of what's in the image. If the image is just decoration, you should use alt="".
`, }), );