This example demonstrates how to set the height of different elements.
HTML file: | Displayed by browser: |
---|---|
<style>
img.normal { height: auto; } img.big { height: 120px; } p.ex { height: 100px; width: 100px; border: 3px solid #8AC007; } </style> <body> <img class="normal" src="../html_beg/images/smiley.gif" width="32" height="32"> <br /><img class="big" src="../html_beg/images/smiley.gif" width="32" height="32"> <p class="ex">The height and width of this paragraph is 100px.</p> <p>This is also a paragraph with no height and width specified.</p> </body> |
![]() ![]() The height and width of this paragraph is 100px. This is also a paragraph with no height and width specified. |