Set border, padding, and background properties

You can add a border, background color and image, and spatial padding to items in a web page or the entire web page by using the Borders and Shading dialog box. You can also set padding in Design view. For more information, see Set margins, padding, and dimensions in Design view.

If you add a border by using the Borders and Shading dialog box, you can customize a border's style, width, and color. When you want to quickly add a preset solid and black border that is 1 pixel wide and padded, use the Outside Borders button Cc295325.0d85edc4-b0d3-45b0-a38d-c4cac647c557(en-us,Expression.30).png

(default setting) on the Common toolbar. The button's ScreenTip name and appearance change to reflect the current selection.

When you use any of these methods, Microsoft Expression Web produces the formatting for you by creating either an inline style or a style that uses a class selector (default), depending on the associated style application settings. To modify these settings, see Set preferences for generated CSS.

  1. In Design view or Code view, in your web page, select the item you want to apply a border to.

  2. On the Common toolbar, either click Outside Borders  Cc295325.0d85edc4-b0d3-45b0-a38d-c4cac647c557(en-us,Expression.30).png or click the arrow next to the button and then select a border style.

  1. In Design view or Code view, in your web page, select the item you want to format.


    To add a border to the entire web page, in Code view, select the <body> tag.

  2. On the Format menu, click Borders and Shading.

  3. In the Borders and Shading dialog box, on the Borders tab, do any of the following:

    • To format a border, set options under Setting, Style, Color, and Width sections.

    • To include a border on only some sides of your item, under Preview, select only those buttons that represent the sides you want to have a border.

    • To set the amount of space that appears either between the border and the item or the border and the contents of the item, under Padding, set values in the Left, Right, Top, and Bottom boxes.


      The Padding property adds space even if you don't set a border.

    • To format the shading of the item, on the Shading tab, set options under Fill.

    • To add a background picture to the item, on the Shading tab, under Patterns, set the URL to your picture in the Background picture box, and then, optionally, set any of the remaining options to control the position and behavior of the background picture.

Community Additions