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

Chapter 7. CSS UNITS > Percentage Units

Percentage Units

In addition to using units of measure in your CSS code, you can also use percentage units to set the width and height of various elements displayed on screen. The behavior is really no different than when using percentage values in standard HTML code, such as using <HR WIDTH=50%> to set a hard rule to half the width of the browser window. Similarly, percentage values in CSS are always relative to another value, most typically the height or width of the browser window. Percentages are always specified using a numeral followed by a percentage sign, in exactly the same way as with a standard HTML tag.

Percentage Units

Using a number followed by a percentage sign ("%") always specifies percentage values in CSS. Percentage values are always relative to another value, such as the width or height of the browser window.


PREVIEW

                                                                          

Not a subscriber?

Start A Free Trial


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