` element at the end of the page.
- Include copyright information about your site inside a `` element so that it will be rendered in small print.
- Add the same navigation menu from the header to the footer. *Why should you provide navigation at the top and bottom of the page?*
7. Experiment with other [HTML Elements](../readings/markup-style/HTML-Elements.pdf), including those you may not have been familiar with already.
7. (Optional) If you haven't already (i.e., for Homework 0) or would like more practice deploying your HTML, consider viewing the `index.html` file in each of the following ways:
1. View your web page in a web browser directly (open the HTML file)
2. Deploy your web page to your local development environment (Docker)
3. Deploy your web page to the [cs4640 server](/resources/cs-server.html)
## Metadata
Next, we will review Open Graph metadata and its use in the web.
See [this short discussion](/readings/markup-style/metadata.html) for additional information about Metadata. Specifically, metadata is included in the `` of the html file.
2. Add the ` ` element to instruct the browser which character encoding to use
```html
```
3. Add a description of the page
```html
```
4. Add the author of the page
```html
```
5. Add the viewport to ensure proper rendering and touch zooming on different display sizes (following mobile first design, which we will discuss soon)
```html
```
The `width=device-width` sets the width of the page to follow the `screen-width` of the device (which will vary depending on the device) the `initial-scale=1` sets the initial zoom level when the page is first loaded by the browser.
### Add Open Graph Metadata
The [Open Graph protocol](https://ogp.me) is a set of metadata that enables your webpages to interconnect more deeply in a social graph. It's used by Facebook, X (formerly known as Twitter), Outlook, and others to showcase your site when a link is shared on the platform. Review their website for more details on what information Open Graph supports.
You should at least include the following metadata elements:
- `og:title` - The title of the object (i.e., page)
- `og:type` - The type of object (likely "website")
- `og:image` - An image to represent your object (page)
- `og:url` - The URL that will be used
- `og:description` - A short description of your object
- `og:site_name` - The larger web site name
These metadata properties have the following format:
```html
```
{: .trythis}
> Try using a different title, image, description and site name in the Open Graph metadata than the one in your HTML's `` and ` ` elements.
>
> Publish your page on the cs4640 server, then try to share it with others (either through Outlook, iMessage, or similar service) to see the preview information provided. If you have a Mac, you can directly share through Safari and see the preview immediately. If you have Outlook, try sending an email with a link to your new page.
>
> **Question:** What information was shared about your page in the preview? How did it differ from the HTML contents and ` ` elements?
## When HTML Goes Wrong
What happens when we do not create "good" HTML? In this activity, we will look at a few different examples.
### W3C Validation Service
When an HTML document does not comply with the W3C's HTML5 standard, most web browsers **do their best** to render the document using their detault settings. HTML5 provides detailed instructions for web browser developers on how to handle mistakes or issues in an HTML5 document; for example, how to handle problems such as missing optional end tags.
However, there are still many problems that web browsers may not be able to handle properly. A common problem is a missing closing tag or mistyped opening and/or closing tag. For example, consider the following HTML.
```html
A First Example
Try including an anchor tag
CS website
without a closing tag.
Then add another paragraph.
Try running this example and see how it looks.
```
**Question:** How does your browser render the example above? How does the browser build this HTML into a DOM tree?
{: .trythis}
> Copy the above HTML and submit it to the [W3C's Markup Validation Service](https://validator.w3.org/nu/).
>
> **Question:** Does the service provide enough information to fix the HTML syntax errors?
>
> Fix the initial problem, then consider the following additional html snippet just before the closing `` tag:
> ```html
>
> Here is a first paragraph
>
> Then another paragraph.
> Try running this example and see how it looks.
>
> ```
>
> **Question:** Does this also contain a syntax error in HTML? It may be helpful to review the [HTML Specification](https://html.spec.whatwg.org/dev/grouping-content.html#the-p-element)
>
> Add it to your earlier HTML and test it with the W3C Markup Validation Service.
Sometimes, problems relate to semantic constraints in HTML. Some HTML elements may have a specific role or meaning, and should appear only once in an HTML document. For instance (as shown below), having multiple intances of the `` element, which describes the main content of an HTML document, in an HTML document would cause the document to be invalid.
```html
This is the main content of the document
Here is more main content of the document
```
Now we will test out the HTML validation service provided by W3C. This service will help us ensure that we're writing good HTML5; it will also provide error messages to help us clean up our code.
1. Create an HTML file and enter the following code
```html
Hello World!
Hello World example
An example HTML Document
Experimenting with W3C's Validation Service
```
2. Go to [W3C's Markup Validation Service](https://validator.w3.org/nu/). Upload your HTML file to validate. The code (previous step) has some problems that should cause validation errors when checking it through the W3C's validation service.
3. Inspect the validation results. Try to correct it. Repeat step 2 until the file is valid.
4. Upload the HTML you created earlier and ensure it is valid. Likewise, try some of the errors we've mentioned above see how the validation service alerts you to those problems.
## Submission
Answer the questions (inline above) on Gradescope in today's Activity assignment. Then upload your HTML file.