Describe the concept of absolute units and relative units. Specifically describe the em and ex units.
What will be an ideal response?
Absolute Units: CSS lets you use absolute measurement values that specify a fixed value. The measurement values require a number followed by one of the unit abbreviations. By convention, do not include a space between the value and the measurement unit. The numeric value can be a positive value, negative value, or fractional value. For example, the following rule sets margins to 1.25 inches:?p {margin: 1.25in;}?You generally want to avoid using absolute units for web pages because they cannot be scaled to the individual user's display type. Absolute units are appropriate when you know the exact measurements of the destination medium. For example, if you know a document will be printed on 8.5 X 11-inch paper, you can plan your style rules accordingly because you know the physical dimensions of the finished document. For this reason, absolute units are better suited to print destinations than web destinations. Although the point is the standard unit of measurement for type sizes, it is not the best measurement value for the web. Because computer displays vary widely in size, they lend themselves better to relative units of measurement that can adapt to different monitor sizes and screen resolutions.?Relative Units: The relative units are designed to let you build scalable web pages that adapt to different display types and sizes. This practice ensures that your type sizes are properly displayed relative to reach other or to the default font size set for the browser.?Relative units are always relative to the inherited size of their containing element. For example, the following rule sets the font size for the
element to 1.5 times (150%) the size of the browser default:?body {font-size: 150%;}?Child elements inherit the percentage values of their parents. For example, aelement within this body element inherits the 150% sizing.?The em Unit: The em is a printing measurement, traditionally equal to the horizontal length of the capital letter M in any given font size. In CSS the em is equal to the font size of an element. It can be used for both horizontal and vertical measurement. In addition to stating font sizes, em is useful for padding and margins as well.?The size of the em is equivalent to the font size of the element. For example, if the default paragraph font size is 12-point text, the em equals 12 points. Stating a text size of 2 em creates 24-point text-two times the default size. This is useful because it means that measurements stated in em are always relative to their environment.?The ex Unit: The ex unit is equal to the height of the lowercase letter x in any given font. Ex is a less reliable unit of measurement than em because the size of the letter x changes in height from one font family to another, and the browser cannot always calculate the difference correctly. Most browsers simply set the ex value to one-half the value of the font's em size. Ex is not commonly used to set font sizes.
You might also like to view...
One common vulnerability exploitation method is a_______, in which a program is overwhelmed by an input of more data than it has allocated space for.
a) buffer overflow. b) memory flood. c) buffer flood. d) None of the above
It is almost always the case that no system resides in a(n) ________
Fill in the blank(s) with correct word
The ____ of a programming language is the set of usage rules for that language.
A. logic B. semantics C. syntax D. GUI
Parentheses are not necessary in prefix expressions.
What will be an ideal response?