Midterm Exam 1
Part 1: Short Answer
Provide short answers to the following questions (one sentence or phrase each). Each question is worth one point, for a total of five points.
-
class
andid
are possible attributes for an HTML element. What is the primary difference between them? - What are the three places we can place CSS code for our web pages?
-
List one reason it is valuable to use semantic markup such as
main
andnav
in our HTML, rather than simply write bare paragraphs or use generic elements such asdiv
? - In CSS, every HTML element can be thought of as a box. What are the four components of the box, from the inside out?
- What is the difference between the Internet and the World Wide Web?
Part 2: Label Parts
Identify an example of each label in the associated piece of code. Each label is worth one point, for a total of nine points.
-
Labels: attribute
element entity
tag value
<aside id="disclaimer"> All content on this page is © 2024 </aside>
-
Labels: declaration
property selector
value
#disclaimer { background-color: lightgray; border: 1px dotted black; }
Part 3: Find Errors
Identify three errors in each piece of code. Provide a very short description of the error (one phrase each). Each error is worth one point, for a total of six points.
-
You may assume that this snippet is in an otherwise valid
html
element.<body> <h1>Hello World!</h1> <p> Welcome to <div class=bold">my first web page</span>. I will write many more. </body>
-
You may assume that this snippet is in an otherwise valid CSS
file.
.page-header { border-bottom: solid, rgb(100, 100, 100), 5px; overflow: auto; margin-top: margin-bottom: 20px; padding-bottom: 5px }
Part 4: Write Code
For each question, write the requested code. Each question is worth five points.
-
Write HTML code for a link to a file named
alan-kay.html
in the folderspeakers
, with Alan Kay as the content. -
Write HTML code to create this content with an ordered list:
James Bond
- Sean Connery
- Roger Moore
- Daniel Craig
-
Write HTML code to create a table that looks like this:
Name Phone number Eugene Wallingford 319-273-5919 - Write CSS code to style a paragraph with 16-point, sans-serif font and a left margin of 1em.
- Write CSS code to style a link so that its text is green and there is no underline (decoration).
-
Write CSS code to style an image so that it is 400px wide, has
a 1px solid black border, 10px of space inside the border, and
25px of space above and below it.
Include alt text of your choice.
That is all!