9

I have a basic ordered list in org mode. After exporting to HTML it takes the default class that org mode assigned:

<ol class="org-ol">

For some lists, however, I'm trying to assign a custom class (like "special_list", for example).

<ol class="special_list">

The org mode documentation says you could add an attribute in this fashion:

#+ATTR_HTML: :class special_list 1. First point 2. Second point

But that doesn't seem to work in this case. Do I have the syntax wrong, or is there a different method for applying custom classes?

1 Answer 1

9

The :class attribute does not seem to apply to lists.

However, you can wrap your list in a custom div this way:

#+begin_pepe
1. One
2. Two
#+end_pepe

This will produce the following HTML:

<div class="pepe">
 <ol class="org-ol">
  <li>One</li>
  <li>Two</li>
 </ol>
</div>

So you can use a CSS selector for that list such as div.pepe ol.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.