• Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint
Share this Page URL
Help

Chapter 7. Border and Margin Controls > Setting the Width and Height of an Elem...

Setting the Width and Height of an Element

The width and height of block-level and replaced elements can be specified with the width and height properties (see "Kinds of HTML Tags" in Chapter 1). Usually, the width and height are determined automatically by the browser and default to being 100% of the available width and whatever height is needed to display all the content. You can use CSS, however, to override both the width and height properties (Code 7.1 and Figure 7.2).

Code 7.1. You can set the width and/or height of an element by using a variety of different units. The most common method is to use pixels. But you can also use centimeters, millimeters, inches, and points, among other options.



PREVIEW

                                                                          

Not a subscriber?

Start A Free Trial


  
  • Creative Edge
  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint