H153 - Practice Quiz Week 4
- What exactly does
line-heightdefine? (Note: despite its name, it does not define the height of a line.)line-heightdefines the height of the inline box. - Explain how the difference in the values of
line-heightandfont-sizeaffect the height of a line. As a concrete example, assume that a paragraph has the following styles:
font-size: 14px; line-height: 20px;The difference between
font-sizeandline-heightis divided in half and then applied to the top and bottom of the element. So, in the example, the difference is6px, so3pxis applied to the top and3pxis applied to the bottom of each line in the paragraph. - Assume a paragraph whose
font-sizeis10px, with eight pixels of space above the baseline and two below. If an image 20 pixels tall is placed on the baseline of a line of text, how tall will the line box be in total? (Assume the image is the tallest element in the line.)22px - As a variation on the previous example, assume the image has a top margin of
-5px. How tall will the line box be in this case?22px17px - Building from the previous example, assume the image has a padding of
3pxand a one-pixel blue border, and a top margin of-10px. How tall will the line box be?26px20px