HTML5 and CSS 3 – Illustrated 2nd Ed. Instructor’s Manual: Unit D Page 12 of 15
TEACHER TIP
Point out that if two positioned elements overlap and a z-index is not specified, the element
positioned last in the HTML code will appear on top. Otherwise, elements with greater z-index
values are in front of elements with lower z-index values.
FIGURES: D-19, D-20, D-21
BOXES
1. Quick Tip: Values for the z-index property can be any number, including a negative number.
Stacking order is based solely on which element has a larger z-index value, not on the actual
value.
2. Clues to Use: Understanding stacking context
Controlling stacking order with the z-index property is straightforward in many cases.
However, in some situations, it’s important to understand some of the finer details of the
property in order to achieve the results you want. The z-index property determines stacking
order based on a stacking context, which is the element containing elements to be stacked.
When stacking sections of a page, stacking order works pretty predictably, as all elements share
3. Clues to Use: Evaluating website layout types
By default, web page content occupies the entire width of a user’s browser window. When most
users accessed the web with a desktop computer, designers often used a static layout, which
specifies a fixed width for the web page content. However, a static layout that’s sized
appropriately for a desktop computer often doesn’t fit on the screen of a smaller device such as a
smartphone. Designers for some websites find that setting a fixed width and expecting users to
scroll and/or zoom to view the entire page is still their best option. However, many other sites
have replaced static layouts with fluid layouts—also known as liquid layouts—in which the
CLASSROOM ACTIVITIES
1. Critical Thinking: You are creating a website for a historical society, and they want you to annotate a
map of the Shenandoah Valley to indicate the locations of Civil War battles that took place in the
valley. The location of each battle should be indicated by an X of a specified color. Can you achieve this
without making changes to the original map by using stacked elements? Explain why or why not.