Exam Review Flashcards
Minimal Document Structure
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8"(>)
<title>Title here</title>
</head>
<body>
<!-- Page content goes here.-->
</body>
</html>
<html>
</html>
- the root element that contains all the elements in the document
- opening and closing
<head>
</head>
contains elements that pertain to the document and are not rendered as content
ex. metadata, style sheets, and scripts
<meta></meta>
- expanded character set: <meta></meta>
- provide document metadata
- provide keywords, author information, publishing status, for search engines
<title>
</title>
- required
- display in the browser tab and bookmark lists, and are used by search engines
<body>
</body>
- contains the content of the document
- everything you want to show up in the browser window
Opening Tag
- the element name in angle brackets
- <element>
ex. <h1>
</h1></element>
Content
- may be text and/or other HTML elements
- between opening and closing tag
ex. <h1>Black Goose Bistro</h>
Closing Tag
starts with a /
ex. </h1>
<br></br>
line break
Attributes
- are instructions that clarify or modify an element in the opening tag after the element name
- can be more than one
- “…” or ‘…’
- <element>Content</element>
ex. <a href(=)”http://oreilly.com”>O’Reilly site</a(>)
Value
a number, word, string of text, URL, or measurement
ex. <img scr(=)”bird.jpg”>
Nesting
putting elements inside other elements
ex.
<div>
<h1>Headline</h1>
<p>This is <em>emphasized</em> text.</p>
</div>
HTML Comments
- for yourself, others, or to hide codes
- visible in source but not browser
ex. <!-- start global navigation -->
<h1>
</h1>
- heading
- max 6 levels/sizes
<p>
</p>
paragraph
Cascading Style Sheets (CSS)
- controls presentation
- includes all styles
href
- provides the location (URL) of HTML documents, images, movies, PDFs
- <a href(=)”URL”>Link text or image</a>
External Links
go to pages that are not on your server
ex. <li><a
href(=)”http://www.foodnetwork.com”>The Food Network</a></li>
Linking to a Higher Directory
- ../ tells the server to back up one level to look for the document index.html
- ../../ for two levels
ex. href=”../index.html”
Site Root Relative Paths
/ means the pathname starts at the root directory so you don’t need to write the name of the directory
ex. href=”/recipes/salmon.html”
Image src Pathnames
used to point to image files with the src attribute
ex. <img src=”/images/icons/next.svg” alt=”next”(>)
target Attribute
tells the browser the name of the window in which you want the linked document to open
target=”_blank”
opens a new browser window
target=”name”
- opens a new window with that name and then opens all subsequent targeted links with that name in the same window
- open in an embedded frame (iframe) with that name
Unordered Lists
- <ul> <li> </li> </ul>
- bullet points
Ordered Lists
- <ol> <li> </li> </ol>
- numbers