Week 1 - Review questions
- 1. Many tags do not have to be closed such as the <p> tag and the <li> tag. Why is it important to have an opening and a closing tag when using STYLES?
- It is important so that the browser knows when to start applying a style and when to stop.
- 2. What is an inline style? Please provide an example.
- An in-line style let you add style to one particular element whether or not you already have an embedded style or a style sheet.
Example:
<h1 style=color: green>This is a green line</h1>
- 3. What is a document level style? Please provide an example.
- The style is added within the <head> of the document.
Example:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<style type="text/css">
<!--body {font-family: chalkboard, monaco, palatino, "sans serif"; background: #EEC591; color: #551011; font-size: 100%;}-->
</style>
</head>
- 4.What is a linked style? Please provide an example.
- All the syles for all the pages are put in one single document called a style sheet.
Example:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<link rel="stylesheet" href="http://www.tropicalboubou.com/CSS/berniestyles.css" type="text/css">
</head>
- 5. In the CSS code h1 { font-family: helvetica, arial, sans-serif; }, which font value is given first priority?
- helvetica
- 6. What does the cascade refer to in Cascading Style Sheets?
- There are sets of rules that apply when different styles are in conlict. Those rules are referred to as the cascade.
- 7. All class names begin with
- a period
- 8. Convert the following statement using CSS.
<font color="#008000" face="Arial">This text is green and in Arial font</font>
- <p style=color:#008000; font-family: arial;>This text is green and in Arial font</p>