You can modify the CSS style definitions for the exported file. The HTML exporter assigns the following special CSS classes133 to appropriate parts of the document—your style specifications may change these, in addition to any of the standard classes like for headlines, tables, etc.
|author information, including email|
|creator info, about org mode version|
|TODO keywords, all not-done states|
|the DONE keywords, all states that count as done|
|each TODO keyword also uses a class named after itself|
|keyword associated with a timestamp, like ‘SCHEDULED’|
|span around keyword plus timestamp|
|tag in a headline|
|each tag uses itself as a class, “@” replaced by “_”|
|target for links|
|the line number in a code example|
|for highlighting referenced code lines|
|div for outline level N (headline plus text)|
|extra div for text at outline level N|
|section number in headlines, different for each level|
|label like “Figure 1:”|
|label like “Table 1:”|
|label like “Listing 1:”|
|how to format an in-lined image|
|formatted source code|
|footnote section headline|
|footnote definition paragraph, containing a footnote|
|a footnote reference number (always a <sup>)|
|footnote number in footnote definition (always <sup>)|
|default class for a linked ‘.svg’ image|
The HTML export back-end includes a compact default style in each exported HTML file. To override the default style with another style, use these keywords in the Org file. They will replace the global defaults the HTML exporter uses.
#+HTML_HEAD: <link rel="stylesheet" type="text/css" href="style1.css" /> #+HTML_HEAD_EXTRA: <link rel="alternate stylesheet" type="text/css" href="style2.css" />
To just turn off the default style, customize
org-html-head-include-default-style variable, or use this option
line in the Org file.
For longer style definitions, either use several ‘HTML_HEAD’ and
‘HTML_HEAD_EXTRA’ keywords, or use
<style> ... </style> blocks
around them. Both of these approaches can avoid referring to an
In order to add styles to a sub-tree, 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. You can also assign a specific class to a headline with the ‘HTML_HEADLINE_CLASS’ property.
Never change the
org-html-style-default constant. Instead use other
simpler ways of customizing as described above.
If the classes on TODO keywords and tags lead to conflicts,
use the variables
org-html-tag-class-prefix to make them unique.