Creating HTML and XHTML files and framesets

Show Me

You can use the New HTML File wizard to create HTML and XHTML files and framesets. You can also use this wizard to create compact HTML and WML 1.3 files.

To create an HTML file using the wizard, complete the following steps:

  1. Open the Web Perspective.

  2. Select File > New > HTML/XHTML File to open the wizard.

  3. Click Browse to select the folder in which your want to create the file.

    Important: Make sure you choose a folder under the WebContent folder of the Web project. This ensures that the file is available for validation, publishing, and deployment.

    Tip: As a shortcut, you can also start the wizard by right clicking on your destination folder and selecting New > HTML/XHTML File from the pop-up menu. This automatically primes the wizard with the folder information.

  4. Type a name for your new file.

  5. Select HTML in the Markup Language drop-down list. Note that you can also create other file types by selecting choices from this list.

  6. You have several options for proceeding:

    - If you want to accept the defaults associated with a new HTML file, make sure Create from page template is unchecked.

    - If you want to apply a page template to your new file, select Create from page template and click Next. A window appears in which you can select a page template. If you want to use one of the sample templates provided, select Sample page template and then choose one of the templates shown in the Thumbnail box. If you want to use a template of your own, select User-defined page template and then click Browse to select the template from the file system.

    - If you do not want to use a page template, but want to specify or customize the file options, select the Configure advanced options check box and click Next.

  7. If you are configuring advanced options, select the appropriate encoding value to add to the file's HTML declaration from the Encoding drop-down list. The default is the value set in the HTML Files preferences page, which is accessed by selecting Window > Preferences, and then expanding the Web and XML Files preferences.

  8. Ensure that the proper content type is selected in the Content Type drop-down list. The default is text/html.

  9. Select the Document Type that you wish to associate with the HTML or XHTML file. The default for an HTML file is HTML 4.01 Transitional; the default for an XHTML file is XHTML 1.1.

  10. Specify a cascading style sheet (CSS) file to be referenced by the new HTML or XHTML file.

    Typically, CSS files are located in the theme folder under the Web content folder. You can use Add to choose a style sheet from the file system. Use Remove to delete a style sheet from the list, or use the arrow buttons to rearrange the order in which the file references the style sheets.

    If a style sheet is already associated with the project in which you are creating the new file, that style sheet is the default.

  11. Click Finish to create the file in the project that you have selected. By default, the new file opens in Page Designer.