We're making Trinket better and faster on new servers. Help us make it better by reporting any issues →
Trinket

A basic webpage

A Basic Webpage

Here's a basic webpage:

If you're logged in to trinket you can click Remix to save a copy of this trinket to your account and begin editing it. The left hand side of the trinket contains the source code, which your browser then uses to render the right hand side of the page.

Key Points

Let's dive into the pieces of the basic website above.

  • HTML pages are made up of a head, which contains any preliminary data, and a body, which contains the content of the page. heads are not required for a page to load but most real webpages have them since they need to load lots of data, provide search engines with summaries of the page, etcetera.
  • The basic building block of HTML is an element, such as the paragraph tag, <p></p>.
  • Elements are placed sequentially or nested inside each other to form the basic structure of the document. Here's a <p></p> element with some text and a bold <b></b> element inside of it:
<p>
  This is some text with a <b>bold</b> element!
</p>
  • Elements are composed of open tags and close tags. The paragraph element's open tag is <p> and its close tag is </p>. These help browsers know where elements start and stop.
  • Some special characters in HTML must be escaped for a browser to display them correctly. These characters, like < and >, are used in the HTML itself so we used escape code when we want the browser to display that character instead of try to interpret it as an element. The escape code for < is &lt;, while the escape code for > is &gt;. Don't worry! You don't have to memorize these. You can easily find helpful lists of them online, or in the HTML reference in this section.