Imperial Valley College Faculty Websites

You are here:Instructors»Robert Gallegos»CIS 212»Homework #4
Tuesday, 20 September 2011 08:53

Homework #4

Written by Robert Gallegos
Rate this item
(0 votes)

CIS 212          Fall 2011         Homework 4                                                  Date handed out: 09/19/2011

Reading Assignment:
7 Putting an “X” into HTML: Moving to XHTML
8 Adding a Little Style: Getting started with CSS

Note: Your answers must be turned in handwritten (no typed responses will be accepted).

Homework due at beginning of class on Monday September 26th:

  1. ____________________ is the new standard for HTML.
     
  2. The “X” in XHTML is for “____________________,” which is another way of saying it’s based on something called XML.

  3. ____________________ stands for eXtensible Markup Language.

  4. YES     or     No     If XML is a language that can be used to invent new markup languages, and HTML is a markup language, can we use XML to recreate HTML?

  5. XHTML’s strict syntax allows ____________________ ____________________ ____________________ and other browsers for the visually impaired to more easily consume Web content. (three words)

  6. By using XHTML I’m ____________________-proofing my Web pages to take advantages of all the latest and greatest browser advances to come.

  7. Unlinke HTML, XHTML can be extended to include new markup. For instance, there are already ____________________ that add elements for vector graphics and mathematical formulas.
  1. XHTML is becoming the language of choice for browsers on ____________________ devices and ____________________ phones.

  2. XHTML can be read by our existing ____________________ applications that already understand how to read XML.

  3. XHTML gives us the benefits of ____________________ (which is great for storing large, structured documents collections) along with the benefits of HTML, such ass CSS for creating presentation.

  4. The XHTML 1.0 checklist: Here’s the list of things you must do to convert from HTML to XHTML.

a. Change your ____________________ to Strict XHTML.

b. Add the ____________________, ____________________, and ____________________ attributes to your <html> opening tag.


c. The <html> tag must be the ____________________ tag after DOCTYPE and the </html> closing tag must be the last tag in the document.

d. All element names must be written with ____________________ letters.

e. All opening tags must have closing tags. Or, if an element is empty, the tag must end with a space and then ____________________>.

f. All attributes must have values, and those values must be surrounded by double ____________________.

g. Don’t use & in the content of your HTL. & is for starting entities, so use ____________________ instead. Also convert any other special characters to entities.

  1. The ____________________ attribute specifies which language the <html> element belongs to.

  2. What your <html> opening tag should look link in XHTML:
    ______________________________________________________________________________

  3. In XHTML, if you aren’t going to have a closing tag, you have to tell the ____________________ about it by putting a slash before the final “>”.

  4. Some older browsers can’t recognize “/>” without a space before the slash, so, to be backwards ____________________, just put a space before your slash in “/>”.

  5. If you element is empty, let the browser know by putting a ____________________ before the ending “>”.

  6. The xmlns attribute holds a unique identifier that determines which language you mean. In the case of XHML, that identitfier is _____________________________________________________________.

  7. If this is XHTML, how come the root element isn’t <xhtml> rather than <html>?

  8. How does the validator know whether I’m validating HTMl or XHTML?

  9. With ____________________, you’re going to completely control the presentation of your pages, often without even changing your XHTML.

  10. Each ____________________ in CSS consist of a location.

  11. You can also write the ____________________ like this:
    p { background-color: red; }

  12. You can add as many properties and values as you like in each ____________________ rule.

  13. CSS is very expressive: it can be used to specify styles in lots of different ways, for lots of different elements – even subsets of ____________________.  

  14. There are plenty of references online, and O’Reilly’s CSS Pocket References is a great little ____________________.  

  15. CSS really is better suited for specifying ____________________ for specifying style information than XHTML.  

  16. You’re also going to see that ____________________ is a much better way to handle styles for multiple pages.

  17. To write a rule for more than one element, just put ____________________ between the selectors.

  18. Describe what the following rules do:

                h1, h2 {
                            font-family: sans-serif;
                            color: gray;
                            }

                h1        {
                            border-bottom: 1px solid black;
                            }

  19. If you use border-bottom then the line will extend to the ____________________ of the page. An underline is only shown ____________________ the text itself.

  20. The property to set text underline is called ____________________ and has a value of “underline” for underlined text.

  21. The style is applied to the ____________________ described by the selector.

  22. We often call CSS files “______________________    __________________”.  (Two words)

  23. A way to tell the browser that it should style this page with the styles in the ______________________
    style sheets. We can do that with an XHTML element called <______________________>.

  24. The property to change the font style is “______________________,” and the value for sans-serif is “______________________”.

  25. (Some) elements can ______________________ styles from their parents.

  26. The __________ - ____________ property is set in the body rule, so every element inside the body inherits the sans-serif font-family from <body>.

  27. To ______________________ the font-family property inherited from body, add a new rule selecting em with the font-family property value set to serif.
  1. YES     or      No     Can I always override a property that is being inherited when I don’t want it?
  1. To write a comment in your CSS just enclose it between ______________________ and ______________________.  

  2. Using both XHTML and CSS, we can define a class of elements, and then apply _____________________ to any element that belongs to that class.  

  3. To add an element to a class, just add the attribute “_____________________” along with the name of the class.

  4. If you want all elements that are in the greentea class to have a style, then you can just write your rule like this: __________________________________________________________________________           

  5. If you leave out all the elements names, and just use a period followed by a _____________________ _____________________ then the rule will apply to all members of the class. (Two words)

  6. Yes     or     No     Elements can be in more than one class?

  7. Use multiple classes when you want an element to have styles you’ve defined in different _____________________.

  8. If there are no selectors that match your element, then you rely on _____________________.

  9. If your element doesn’t inherit the value from any of its ancestors, then you use the default value defined by the _____________________.

  10. If you can’t resolve a conflict because two selectors are equally specific, you use the ordering of the rules in your style sheet file. That is, you use the rule listed in the CSS file (_____________________   _____________________  _____________________). (Three words)

  11. Yes     or      No     Is there a way to validate CSS like there is with HTML and XHTML?