CSCI 4300 NEW MIDTERM EXAM WITH 100%
CORRECT ANSWERS
Absolute Link - ANSWER when referencing a page or resource on an external site, a
full absolute URL reference is required (protocol, domain, path, file)
To have the page open in a new tab set the
attribute: target="_blank
ex: http://www.google.com
Relative Link - ANSWER when referencing a resource that is on the same server use
relative referencing
ex: images/headshot_ds.jpg
same directory: use file name
child directory: name of subdirectory/filename
Parent/ancestor directory / sibling directory : ../
Div tags - ANSWER <div> is a container element, used to group elements on the page
division: container for the text of other HTML
HTML elements - boilerplate - ANSWER <!DOCTYPE html>
<html lang="en">
<head>
<title>Diane's page </title>
<head>
<body>
this is my page.
,</body>
</html>
<head> components - ANSWER <title> tag: important role in search engine
optimization, determines how page appears in searches
<link>
<meta> : Additional info for search engines
block elements - ANSWER - Starts on a new line
- Browsers Automatically add some space before and after the element
- Takes up the full width available
Inline Elements - ANSWER - does not start on a new line
- an inline element only takes up as much width as necessary
examples: <a> , <br> , <img>
link - ANSWER <a href="http://ww.google.com"> lookup</a>
a stands for anchor
<img> - ANSWER <img src = "images/mycat.jpg" alt="Rocky the beast">
- singleton tag
src: path to image
alt: alternative textual descriptions
<headings> - ANSWER - 6 levels of headings
<h1></h1> ... <h6></h6>
,<list> - ANSWER Ordered list:
<ol><li>
Unordered List:
<ul><li>
Description lists:
<dl>
<dt></dt> <dd></dd>
</dl>
Forms - ANSWER <form> </form>
- allow users to enter information and or make selections
- container for different types of input elements:
text fields, checkboxes, radio button, submit buttons
HTML forms - ANSWER action attribute: specifies URL where the form data should be
sent
method: which HTTP method should be used
- post: form data is sent as the request body
-get: form data is appended to the action url w a separator
Internal CSS - ANSWER <style></style>
-Style rules can be placed within <style> tags
inside the <head> section of the HTML page.
-Although an improvement over inline CSS,
internal CSS is largely discouraged.
External CSS - ANSWER <link rel="stylesheet" href="styles.css" />
, linked in the head section of html
browsers cache the external style sheet which improves performance
CSS selectors - ANSWER -elements
-classes
- ids
Element selectors - ANSWER - Selects all elements with the specified element
name - ie. html tag.
- Multiple elements may be separated by commas.
ex.
img {
width: 100px;height: 200px;
}
h1, h2 {
color: magenta;
}
class selectors - ANSWER - begin with a dot (.)
- matches elements that belong to the specific class
ID selectors - ANSWER - begins with a #
Selects a specific element on the page with a matching Id
Descendent Selectors - ANSWER Combines two selectors. Specify elements if
CORRECT ANSWERS
Absolute Link - ANSWER when referencing a page or resource on an external site, a
full absolute URL reference is required (protocol, domain, path, file)
To have the page open in a new tab set the
attribute: target="_blank
ex: http://www.google.com
Relative Link - ANSWER when referencing a resource that is on the same server use
relative referencing
ex: images/headshot_ds.jpg
same directory: use file name
child directory: name of subdirectory/filename
Parent/ancestor directory / sibling directory : ../
Div tags - ANSWER <div> is a container element, used to group elements on the page
division: container for the text of other HTML
HTML elements - boilerplate - ANSWER <!DOCTYPE html>
<html lang="en">
<head>
<title>Diane's page </title>
<head>
<body>
this is my page.
,</body>
</html>
<head> components - ANSWER <title> tag: important role in search engine
optimization, determines how page appears in searches
<link>
<meta> : Additional info for search engines
block elements - ANSWER - Starts on a new line
- Browsers Automatically add some space before and after the element
- Takes up the full width available
Inline Elements - ANSWER - does not start on a new line
- an inline element only takes up as much width as necessary
examples: <a> , <br> , <img>
link - ANSWER <a href="http://ww.google.com"> lookup</a>
a stands for anchor
<img> - ANSWER <img src = "images/mycat.jpg" alt="Rocky the beast">
- singleton tag
src: path to image
alt: alternative textual descriptions
<headings> - ANSWER - 6 levels of headings
<h1></h1> ... <h6></h6>
,<list> - ANSWER Ordered list:
<ol><li>
Unordered List:
<ul><li>
Description lists:
<dl>
<dt></dt> <dd></dd>
</dl>
Forms - ANSWER <form> </form>
- allow users to enter information and or make selections
- container for different types of input elements:
text fields, checkboxes, radio button, submit buttons
HTML forms - ANSWER action attribute: specifies URL where the form data should be
sent
method: which HTTP method should be used
- post: form data is sent as the request body
-get: form data is appended to the action url w a separator
Internal CSS - ANSWER <style></style>
-Style rules can be placed within <style> tags
inside the <head> section of the HTML page.
-Although an improvement over inline CSS,
internal CSS is largely discouraged.
External CSS - ANSWER <link rel="stylesheet" href="styles.css" />
, linked in the head section of html
browsers cache the external style sheet which improves performance
CSS selectors - ANSWER -elements
-classes
- ids
Element selectors - ANSWER - Selects all elements with the specified element
name - ie. html tag.
- Multiple elements may be separated by commas.
ex.
img {
width: 100px;height: 200px;
}
h1, h2 {
color: magenta;
}
class selectors - ANSWER - begin with a dot (.)
- matches elements that belong to the specific class
ID selectors - ANSWER - begins with a #
Selects a specific element on the page with a matching Id
Descendent Selectors - ANSWER Combines two selectors. Specify elements if