From mboxrd@z Thu Jan 1 00:00:00 1970 From: Juan Pechiar Subject: Re: Apply custom CSS class to headings in HTML export? Date: Thu, 31 Mar 2011 20:27:54 -0300 Message-ID: <20110331232754.GB2276@soloJazz.com> References: <20110331184645.1ad5ae43amscopub-mail@yahoo.com@dove.localdomain> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Return-path: Received: from [140.186.70.92] (port=52277 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Q5RHV-0001PU-IP for emacs-orgmode@gnu.org; Thu, 31 Mar 2011 19:28:02 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Q5RHU-0003eF-8u for emacs-orgmode@gnu.org; Thu, 31 Mar 2011 19:28:01 -0400 Received: from oproxy1-pub.bluehost.com ([66.147.249.253]:40360) by eggs.gnu.org with smtp (Exim 4.71) (envelope-from ) id 1Q5RHT-0003e6-Sg for emacs-orgmode@gnu.org; Thu, 31 Mar 2011 19:28:00 -0400 Content-Disposition: inline In-Reply-To: <20110331184645.1ad5ae43amscopub-mail@yahoo.com@dove.localdomain> List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: Uriel Avalos Cc: emacs-orgmode@gnu.org You can add custom styles via properties: In order to add styles to a subtree, use the :HTML_CONTAINER_CLASS: property to assign a class to the tree. In order to specify CSS styles for a particular headline, you can use the id specified in a :CUSTOM_ID: property. http://orgmode.org/manual/CSS-support.html#CSS-support So you should do something like: #+begin_example org * Top heading ** Resource :PROPERTIES: :HTML_CONTAINER_CLASS: resource :END: #+end_example This exports as #+begin_example html

Resource

... #+end_example So you can define styles thus: #+begin_example css div.resource h2 { font: comic_sans_forever; } #+end_example regards, .j. On Thu, Mar 31, 2011 at 06:46:45PM -0400, Uriel Avalos wrote: > Suppose that you export the following document to HTML: > > * Heading 1 > ** Heading 2 > > The HTML structure is pretty much the following: > > div class=outline-2 > h2 Heading 1 > div class=outline-text-2 > div class=outline-3 > h3 Heading 2 > > Is there a way to apply a custom CSS class to the: > > 1. containing div (outline-2)? > 2. heading itself (h2)? > 3. text inside of the heading (outline-3)? > > Why? Suppose you have the following document > > * Heading 1 > ** Resources > ** Answers > * Heading 2 > ** Quiz > ** Resources > ** Answers > > You need to apply a different style to the Resources and > Quizzes. Unfortunately, these don't always appear in an > outline and they don't always appear in the same order. It > is infinitely easier to use a custom CSS class with each > heading.