HTML and CSS Reference
In-Depth Information
Notice also that you are setting the padding in the statement to an “em” measurement
value. Table 7-4 describes the units that can be used by Web developers.
Em Units
The em is a very useful
unit in CSS, because it
adapts automatically to
the font size that the Web
page visitor uses.
Table 7-4 Measurement Values
Unit
Description
%
percentage
Measurement Values
When is it best to use
the “em” measurement
versus using the “pt”
measurement? There are
many advanced Web page
design resources available
that discuss this topic.
The main goal with any
measurement value is to
design a Web page so that
it is legible.
in
inch
cm
centimeter
mm
millimeter
em
1em is equal to the current font size; 2em means 2 times the size of the current font.
For example, if an element is displayed with a font of 12 pt, then 2em is 24 pt
ex
one ex is the x-height of a font (x-height is usually about half the font size)
pt
point (1 pt = 1/72 inch)
pc
pica (1 pc = 12 points)
px
pixels (a dot on the computer screen)
Line 18 also sets the cursor to the default value using cursor: default as the
statement. If you do not have this statement, then you would not see a cursor as
shown in Figure 7-5a. With this cursor code statement inserted, you see the cursor as
shown in Figure 7-5b.
(a)
navigation bar with three options
as defined by three unordered lists
named Water Expeditions, Exotic
Destinations, and Cycling Tours
cursor showing when mouse
hovers over nonlinked area
of navigation bar (default)
(b)
Figure 7-5
The next section of code that you will add to the jaredadam.html embedded style
sheet (lines 20 through 28 shown below) specifies additional styles for the navigation bar
and submenus.
20
.menu ul {display: none; position: absolute;
background-color: white;
21
list-style: none; margin: 2px 5px 5px 0;
padding: 0;}
22
 
Search WWH ::




Custom Search