HTML Document Standards Flashcards
why do you need a <!DOCTYPE html>
It tells the browser what type of document to expect,
why do you need the <html> tag
Anything between the opening <html> and closing </html> tags will be interpreted as HTML code
what is the < head >
The <head> element contains the metadata for a web page. Metadata is information about the page that isn’t displayed directly on the web page.
why is <title> within the <head></title>
A browser’s tab displays the title specified in the <title> tag. The <title> tag is always inside of the <head>.</title></title>
<html>
<head>
<title>My Coding Journal</title>
</head>
</html>
explain linking to webpage using <a></a>
You can add links to a web page by adding an anchor element <a> and including the text of the link in between the opening and closing tags.</a>
<a>This Is A Link To Wikipedia</a>
what does the target and _ blank element do
For a link to open in a new window, the target attribute requires a value of _blank. The target attribute can be added directly to the opening tag of the anchor element, just like the href attribute.
<a>The Brown Bear</a>
what is the root directory
hen making multi-page static websites, web developers often store HTML files in the root directory, or a main folder where all the files for the project are stored. As the size of the projects you create grows, you may use additional folders within the main project folder to organize your code.
project-folder/
|—— about.html
|—— contact.html
|—— index.html
TML files are often stored in the same folder, as shown in the example above. If the browser is currently displaying index.html, it also knows that about.html and contact.html are in the same folder. Because the files are stored in the same folder, we can link web pages together using a relative path.
<a>Contact</a>
what does the ./ do for index Html
the ./ in ./index.html tells the browser to look for the file in the current folder.
how do you use the Img element to make a image a hyperlink
by simply wrapping the <img></img> element with an <a> element.</a>
<a><img></img></a>
how do we allow user to press a link to a specific section of the page
n order to link to a target on the same page, we must give the target an id, like this:
<p>This is the top of the page!</p>
<h1>This is the bottom! </h1>
The target link is a string containing the # character and the target element’s id.
<ol>
<li><a>Top</a></li>
<li><a>Bottom</a></li>
</ol>
how do you make a comment using <!-- -->
<!-- Favorite Films Section -->
<p>The following is a list of my favorite films:</p>
recap
The <!DOCTYPE html> declaration should always be the first line of code in your HTML files. This lets the browser know what version of HTML to expect.
The <html> element will contain all of your HTML code. Information about the web page, like the title, belongs within the <head> of the page. You can add a title to your web page by using the <title> element, inside of the head. A webpage’s title appears in a browser’s tab. Anchor tags (<a>) are used to link to internal pages, external pages or content on the same page. You can create sections on a webpage and jump to them using <a> tags and adding ids to the elements you wish to jump to. Whitespace between HTML elements helps make code easier to read while not changing how elements appear in the browser. Indentation also helps make code easier to read. It makes parent-child relationships visible.
Comments are written in HTML using the following syntax: <!-- comment -->.