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

Chapter 21. Cascading Style Sheets and C... > HTML Element Box Attributes

HTML Element Box Attributes

A number of style attributes enables you to work with the box an element are drawn in, such as border, which enables you to draw a border around an element. You can see a sampling of such attributes in Table 21.5.

Table 21.5. HTML Element Box Style Attributes
Attribute NS2 NS3 NS4 NS6 IE3a IE3b IE4 IE5 IE5.5 IE6
border   x x   x x x x
  CSS1: [ <border-width> || <border-style> || <color> ]
  CSS2: inherit
  Default:Varies
  Applies to: All elements
  This attribute is a shorthand attribute enabling you to set the width, color, and style for all four borders of a box at one time.
border-top, border-right, border-bottom, border-left    x   x x x x
  CSS1: [ <border-top/right/bottom/left-width> || <borderstyle> || <color> ]
  CSS2: inherit
  Default:Varies
  Applies to: All elements
  Sets the width, style, and color of the top, right, bottom, and left border of a box.
border-color   x x   x x x x
  CSS1: <color>{1,4} | transparent
  CSS2: inherit
  Default:Varies
  Applies to: All elements
  Sets the color of the borders of a box.
border-top-color, border-right-color, border-bottom-color, border-left-color   x x   x x x x
  CSS1: <color>
  CSS2: inherit
  Default:Varies
  Applies to: All elements
  Specifies the color of a border of a box.
border-style   x x   x x x x
  CSS1: <border-style>{1,4}
  CSS2: inherit
  Default:Varies
  Applies to: All elements
  Specifies the style of the four borders of a box. You can give from one to four values at the same time.
border-top-style, border-right-style, border-bottom-style, border-left-style   x x   x x x x
  CSS1: <border-style>
  CSS2: inherit
  Default: none
  Applies to: All elements
  Specifies the style of a specific border of a box.
border-width   x x   x x x x
  CSS1: <border-width>{1,4}
  CSS2: inherit
  Default: Not defined
  Applies to: All elements
  Inherited: No
  This is a shorthand attribute for setting the border-top-width, border-right-width, border-bottom-width, and border-left-width attributes at once.
border-top-width, border-right-width, border-bottom-width, border-left-width   x x   x x x x
  CSS1: <border-width>
  CSS2: inherit
  Default: medium
  Applies to: All elements
  Sets the border widths of the sides of a box.
clear   x x   x x x x
  CSS1: none | left | right | both
  CSS2: inherit
  Default: none
  Applies to: Block-level elements
  This attribute specifies to the browser that the sides of an element’s box should not be next to a previous floating box.
height, width   x x   x x x x
  CSS1: <length> | <percentage> | auto
  CSS2: inherit
  Default: auto
  Applies to: All elements except inline elements, table columns, and column groups
  Sets the height or width of boxes.
margin   x x x x x x x x
  CSS1: <margin-width>{1,4}
  CSS2: inherit
  Default: Not defined
  Applies to: All elements
  This attribute is a shorthand attribute for specifying the margin-top, margin-right, margin-bottom,and margin-left attributes all at once.
margin-top, margin-right, margin-bottom, margin-left   x x x x x x x x
  CSS1: <margin-width>
  CSS2: inherit
  Default: 0
  Applies to: All elements
  Correspond to the top, right, bottom, and left margin of a box.
max-height, max-width       x x x x
  CSS2: <length> | <percentage> | none | inherit
  Default: none
  Applies to: All elements except non-replaced inline elements and table elements
  Set constraints on box heights and widths.
min-height, min-width       x x x x
  CSS2: <length> | <percentage> inherit
  Default: 0
  Applies to: All elements except non-replaced inline elements and table elements
  Enables you to set minimum box heights and widths.
padding   x x   x x x x
  CSS1: <length> | <percentage>
  CSS2: inherit
  Default: Not defined
  Applies to: All elements
  This is a shorthand attribute for setting the padding-top, paddingright, padding-bottom,and padding-left attributes all at once.
padding-top, padding-right, padding-bottom, padding-left   x x   x x x x
  CSS1: <length> | <percentage>
  CSS2: inherit
  Default: 0
  Applies to: All elements
  Specifies the top, right, bottom, and left box padding.



PREVIEW

                                                                          

Not a subscriber?

Start A Free Trial


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