From mboxrd@z Thu Jan 1 00:00:00 1970 From: Jambunathan K Subject: Re: Applying style to a paragraph for HTML export Date: Thu, 05 May 2011 20:05:12 +0530 Message-ID: <81aaf1nrkv.fsf@gmail.com> References: <29314.1304604320@alphaville.dokosmarshall.org> Mime-Version: 1.0 Content-Type: text/plain Return-path: Received: from eggs.gnu.org ([140.186.70.92]:33074) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QHzeI-0007SW-7A for emacs-orgmode@gnu.org; Thu, 05 May 2011 10:35:27 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1QHzeG-0003d1-2N for emacs-orgmode@gnu.org; Thu, 05 May 2011 10:35:26 -0400 Received: from mail-pv0-f169.google.com ([74.125.83.169]:55456) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QHzeF-0003cn-Of for emacs-orgmode@gnu.org; Thu, 05 May 2011 10:35:23 -0400 Received: by pvc12 with SMTP id 12so1419157pvc.0 for ; Thu, 05 May 2011 07:35:23 -0700 (PDT) In-Reply-To: <29314.1304604320@alphaville.dokosmarshall.org> (Nick Dokos's message of "Thu, 05 May 2011 10:05:20 -0400") List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: emacs-orgmode@gnu.org Nick Dokos writes: > Robert Pluim wrote: > >> (I thought this would be a FAQ, but I can't find anything similar) >> >> Hi, >> >> I'm exporting from org to html, which is working well. Since my final >> target is MSWord, I'd like to add style information to various >> paragraphs, ie bold, underline etc. I can see how to do eg *bold* for >> individual words, but how do I apply that kind of formatting to a span >> of text? >> >> (I'm CSS-ignorant, so please use small words and talk slowly) >> > > Reading section 12.5.8, "CSS support", and experimenting a bit, > I came up with a short example that I hope will clarify that section > for the CSS-ignorant (which I mostly am): > > #+OPTIONS: ^:nil > #+STYLE: > #+STYLE: > > * Headline > :PROPERTIES: > :HTML_CONTAINER_CLASS: bold > :END: > This is a bold section. This is done by using the HTML_CONTAINER_CLASS > property of the subtree and giving it the value bold, then setting the > style for class _bold_ to accomplish the desired goal. > > But you can selectively > #+HTML: > change some things like this > #+HTML: > if you want. or like this: --8<---------------cut here---------------start------------->8--- @ change some things like this @ --8<---------------cut here---------------end--------------->8--- Note the "at"s preceding the html tags. > > Here is what I know about CSS (but take it with the appropriate grain > of salt - as I said, I'm mostly CSS-ignorant): > > The thing to remember is that you can add ... to delimit > HTML inline elements and
...
for HTML block elements. > > Each can be given a class: ... or an id: > .... Classes are hierarchical, ids are targeted. > > In the style definitions, you write > > .foo { style info; ...} > > for classes and > > #bar {style info; ...} > > for ids. > > So you can use #+HTML: ... to add spans or divs at the appropriate > places, giving them a class or id as you see fit, and then add #+STYLE: > definitions at the top to style them. > > Be careful when typing: the slightest error will cause the browser to just > ignore whole swaths of styling, which makes debugging ... interesting. > I tend to edit the html file one tiny thing at a time and redisplaying. When > I've figured out what's wrong, I go back to the org file and try the result. > > Nick > > --