You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 10 Next »

How to set the CSS/Theme of a Diva Look app

Diva look introduces a new D2W key: stylesheet.
The CSS file computed by this key will be set as the global stylesheet for the application.





session.theme = 'Simple'



A closer look at the CSS file...

1. CSS Imports
@import url("_Neutral.css");
@import url("ERDIVEditPage.css");
@import url("NeutralEditToManyFault.css");
@import url("NeutralEditToOneFault.css");
@import url("NeutralCalendarDateSelect.css");
@import url("NeutralAjaxAccordion.css");
@import url("NeutralEditToOneRelationship2.css");

The CSS file _Neutral.css imports a global CSS for the theme, a generic one for the edit page ERDIVEditPage.css and CSS files for D2W components used on an edit page.


IE has a limitation of a max. of 32 CSS files per page (and a depth of 3).

2. Image Replacement
div#a h1.edit {
	background: url(/WebObjects/Frameworks/JavaDirectToWeb.framework/WebServerResources/EditMetalBan.gif) no-repeat;
	text-indent: -5000px;

Standard CSS image replacement applies.

Here, the edit page banner is being set. div#a h1.edit is an example of a CSS selector. Diva D2W page content is nested inside a <div id="a">..</div>. See: Layout of a Diva Look Page. Therefore it's CSS selector is div#a. The page title is marked up as <h1 class="edit">..</h1>, so the resulting CSS selector for that element would be h1.edit or more specifically div#a h1.edit.


All CSS selectors in a Diva D2W page begin with div#a.

  • No labels