| CS 199 | Willamette University | Spring, 2019 |
|
Programming in PHP, Databases with MySQL, and Web Applications |
||
This lab provides some initial practice with cascading style sheets, classes, and div tags.
In working with color (either for a font or for the background of a region), HTML considers an overall color as being a composite of red, green, and blue, often abbreviated RGB.
The amount of each color is given on a scale from 0 through 255.
| Pure red is maximum red with no green or blue—sometimes represented as rgb(255, 0, 0). | |
| Pure green is maximum green with no red or blue—sometimes represented as rgb(0, 255, 0). | |
| Pure blue is maximum blue with no red or green—sometimes represented as rgb(0, 0, 255). | |
| White represents a maximum amount of each color, rgb(255, 255, 255) | |
| Black represents the absence of color, rgb(0, 0, 0). |
Many sources on the Web provide RGB values for a wide range of colors. See for example, https://www.rapidtables.com/web/color/RGB_Color.html or https://en.wikipedia.org/wiki/Web_colors.
Consider the sample-css-page.html and its associated style sheet: style-lab.css.
Click on each of these links: note that the results will appear in different tabs in your browser. Save each of these files in the CS-199 shared drive: mb://cs-199.willamette.edu/www, using a filename for your collaborative team. (The filename might be something like sample-css-page-???.html and style-lab-???.css, where ??? is related to your team.
Open both the sample-css-page-???.html and style-lab-???.css in TextEdit. Within file sample-css-page-???.html, change the style sheet reference to style-lab-???.css
In reviewing the page and style sheet, explain how the following elements on the page are achieved:
Check whether the sample page and style sheet conform to the standards of the World Wide Web Consortium. Explain the steps you used for checking.
For the bibliography and citation, change the attributes of the relevant class, so the top and bottom margins are just 30px each, and the left and right margins are 50px each.
Adjust the style for an h1 header, so the font is larger than in the original.
Adjust the style for an h2 header, so the font color is green in each case.
What happens when a class name is misspelled on an html page?
What happens when an attribute is misspelled in a cascading style sheet?
In the stylesheet specification for a paragraph, what happens if the bottom margin is set to 0px? Explain.
Make additional changes to at least four elements of the style sheet. In each case, indicate the change made and how that change is reflected when the page is loaded into the browser.
Create a new page with at least two headers and at least 3 paragraphs. Then use a style sheet, so that various parts of the page have different appearances. Separate from the page and style sheet, write a brief description of your vision for the appearance of the resulting page and how your text and style sheet implement that vision.
|
created 15 January 2019 revised 22-23 January 2019 |
|