How to: Collapse and Expand HTML Elements in Visual Web Developer

To help you work with large pages, Source view allows you to create outline regions. You can then collapse and expand the regions when you want to hide or show them.

By default, the editor is configured to treat certain HTML elements as collapsible regions. You can set options to change which elements are collapsible and how many lines the element must contain before it is automatically treated as a collapsible region. For details, see Tag Specific Options.

To create or remove a collapsible region

  1. Select the text you want to treat as a collapsible region.

  2. To create a collapsible region, on the Edit menu, point to Outlining, and then click Hide Selection.

    The editor turns the selection into a region, collapses it, and displays a box with an ellipsis (...) to indicate that the area contains a collapsed area. You can hold the mouse pointer over the box to see its contents.

  3. To remove a collapsible region, collapse it, and then click it to select it.

  4. On the Edit menu, point to Outlining, and then click Stop Hiding Current.

To collapse and expand a single region

  1. To collapse a region, click the minus sign (-) in the margin of the editor.

  2. To expand a collapsed region, click the plus sign (+) in the margin.

To collapse and expand all regions

  • On the Edit menu, point to Outlining, and then click Toggle All Outlining.

See Also

Other Resources

Source View, Web Page Designer