UMass Lowell Dept. of Computer Science

91.461 GUI Programming I

Fall 2015 Semester, Section 201

Prof. Jesse M. Heines

Notes for Class No. 10

CSS Inheritance, Managing the Cascade, and Two-Column Layouts, plus Introduction to JavaScript

Thursday, October 1, 2015

A video of this class is (or will be) posted at:   http://echo360.uml.edu/heines201516/guiprogramming1.html


Handouts and Materials


Openings / Announcements / Reminders


Class Notes

Related reading for this class:  JS&jQ:TMM Ch. 1-3

CSS Inheritance  (CSS:TMM Ch. 4)

Classic inheritance vs. CSS inheritance

General rules for CSS inheritance  (CSS:TMM pp. 83-85/95-97)

CSS:TMM Appendix A lists all CSS properties and indicates which get inherited and which do not starting on page 463/563


Managing the Cascade  (CSS:TMM Ch. 5)

The previous chapter and exercise introduced the cascade, this one goes into more detail

As you saw in the previous exercise, inherited styles accumulate

Inheritance rules

Specificity  (CSS:TMM p. 96/108)

Figure 5-3
[figure source:  CSS: The Missing Manual, by David Sawyer McFarland, Fig. 5-3, p. 97/109]

Other issues

It is impossible to memorize all these rules


Two-Column Layouts

Textbook Figures

Figure 13-2.  Creating a two-column layout is a simple matter of floating a <div> tag to the left (top). To make a sidebar move from the left to right side of the page (middle), just change the sidebar’s CSS styling to float: right. You don’t need to make any other changes to your CSS or HTML.

Figure 13-3.  A three-column design uses the same concepts used to create a two-column design.  In this case, you float both the left and right sidebars and add both left and right margins to the center column.  The lefthand diagram shows the order of the HTML; the right side shows what the web page looks like.

Figure 13-4.  There’s more than one way to float a page.  CSS’s flexibility provides many ways to create a multicolumn layout.  Using different methods of floating, you can easily change the source order of the HTML for the page, as you can see in the diagrams at left.  Right-side diagrams represent final web page layout.


Marc Andreessen
Wikipedia
Time, Feb. 19, 1996
Tim Berners-Lee
Wikipedia
TED Talk, Feb. 3, 2009
Introduction to JavaScript

A Bit of History

Client-side computing

Basic structure and use

 



This is document http://jesseheines.com:8080/~heines/91.461/91.461-2015-16f/461-lecs/lecture10.jsp.  It was last modified on Friday, August 26, 2022 at 4:09 PM.
Copyright © 2022 by Jesse M. Heines.  All rights reserved.  May be freely copied or excerpted for educational purposes with credit to the author.