Adding a Style Sheet to a JSP Page

You can add a style sheet reference to your page, so that your headings, text, and other elements are formatted in a consistent way with the presentation features, such as the fonts and colors used in the Web pages. You can add a style sheet to the page as follows:

  1. With employees.jsp open in the Visual Editor, click the list arrow at the top right of the Component Palette, and select CSS.

    Figure 4-5 Selecting a CSS File for the JSP

    Description of Figure 4-5 follows
    Description of "Figure 4-5 Selecting a CSS File for the JSP"
  2. From the CSS list, drag JDeveloper onto your page. As soon as you drag JDeveloper onto your page, it will ask you to save the jdeveloper.css file. Save the file in the same location as your JSP file. After you save the CSS file, it formats the page with the JDeveloper styles. Figure 4-6 shows the JSP Page with the content added to it in the previous section and the JDeveloper stylesheet applied to it.

    Figure 4-6 Adding Static Content to the JSP Page

    Description of Figure 4-6 follows
    Description of "Figure 4-6 Adding Static Content to the JSP Page"

    Note:

    In JDeveloper version 10.1.3, you can associate a stylesheet with the JSP page while creating it in the JSP Creation Wizard. The only difference is that you need to browse and locate the stylesheet to be applied to the JSP page, instead of just dragging and dropping it onto the page.