When I export an org-mode file to HTML, I'd like to limit the line width to make it easier to read. Can setting max-width with #+ATTR_HTML: help me do that? If so, how? If not, is there a way? I'd prefer doing it on a per-file basis rather than globally or per-paragraph.
I'm using Emacs 23.3.1 and org-mode 7.8.03.
You can setup css style to limit max-width on a per-file basis:
#+HTML_HEAD: <style type="text/css">body{ max-width:50%; }</style>
Also there is a way on per-heading setup:
#+HTML_HEAD: <style type="text/css">#outline-container-introduction{ max-width:30%; }</style>
and then set property of concrete heading:
:PROPERTIES:
:CUSTOM_ID: introduction
:END:
Upd.: Replaced #+STYLE
by #+HTML_HEAD
Hi, there.
Note that using only the max-width tag as advised above will place the entire body content to left by default. If you wanted, additionally, to center it on the screen, you need to add and set the margin tag to auto by adding margin: auto;
It makes it to look much better for me, try it.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With