IMG {display: block; width: auto;}
Figure 8-26

Figure 8-26. Replaced elements with auto width are rendered using their intrinsic size

Replaced elements can have their height andwidth set to a value other thanauto or their intrinsic dimensions. This is mostcommonly used to "scale" images, either up or down. Thus,if an image is 150 pixels wide and its width isset to 75px , then the image will be displayedhalf as wide as it would ordinarily appear. In most browsers, theheight will be scaled to match, unless it has been explicitly set to Wednesday 26th of October 2016 05:57:45 AM

by Eric A. Meyer
ISBN 1-56592-622-6
First edition, published May 2000.
(See the
catalog page for this book.)

Search the text of Cascading Style Sheets: The Definitive Guide.

Table of Contents

Copyright Page
Chapter 1: HTML and CSS
Chapter 2: Selectors and Structure
Chapter 3: Units and Values
Chapter 4: Text Properties
Chapter 5: Fonts
Chapter 6: Colors and Backgrounds
Chapter 7: Boxes and Borders
Chapter 8: Visual Formatting
Chapter 9: Positioning
Chapter 10: CSS2: A Look Ahead
Chapter 11: CSS in Action
Appendix A: CSS Resources
Appendix B: HTML 2.0 Style Sheet
Appendix C: CSS1 Properties
Appendix D: CSS Support Chart
Library Navigation Links

Copyright © 2002 O'Reilly & Associates. All rights reserved.

Figure 4-27

Figure 4-27. Tall images don't change line height

Again, the actual value for line-height in Figure 4-27 is the same for every line.

You can take advantage of the fact that line-height can be set for any element, including inline elements. Let's return to our previous example and make one small change by adding a line-height to the styles for the BIG element. We'll also change the line-height of the P element from 23pt to 27pt. This will have the result shown in Figure 4-28: