tag:support.markedapp.com,2011-09-11:/discussions/questions/9246-is-an-easy-way-to-change-font-in-default-or-custom-css-styleMarked: Discussion 2019-03-01T14:50:06Ztag:support.markedapp.com,2011-09-11:Comment/470198852019-03-01T07:58:04Z2019-03-01T07:58:05ZIs an easy way to change font in default or custom css style?<div><p>Hi</p>
<p>I'm using Marked 2 to export to PDF. I have both the default .css styles and some custom made styles that I have downloaded for Github. I wanna be able to change between different the styles before I export my document and at the same time wanna be able to see the same font (Times New Roman 12 pt) in all style templates I using both in Marked 2 and into the final PDF file.</p>
<p>What's the easiest way to do this? At the moment I have used the Additional CSS box under "Theme" and writing this:</p>
<p>div {<br>
text-align: justify; text-justify: inter-word; }</p>
<p>p.serif {<br>
font-family: "Palatino Linotype", "Book Antiqua", Palatino, serif; }</p>
<p>The text-align command works like a charming but the p.serif don't make any difference in the document or into the final PDF file. I'm not good with HTML.</p>
<p>Grateful for help</p>
<p>Thanks.</p>
<p>Simon</p></div>Simontag:support.markedapp.com,2011-09-11:Comment/470198852019-03-01T14:50:05Z2019-03-01T14:50:05ZIs an easy way to change font in default or custom css style?<div><p>There is no "serif" class applied to paragraphs, so you need a different selector on the rule. Specificity will help. If you want to change all fonts in the page to Palatino, you would use something like this in the Additional CSS box:</p>
<pre>
<code>#wrapper {
text-align: justify;
text-justify: inter-word;
}
#wrapper * {
font-family: "Palatino Linotype", "Book Antiqua", Palatino, serif!important;
}</code>
</pre>
<p>That would change the font of every element in every theme to Palatino. Note that I changed <code>div</code> to <code>#wrapper</code> as well to prevent the style from affecting Marked's own elements (like the Table of Contents, etc.). You also need the <code>!important</code> to ensure it overrides any more specific font declarations in a given theme.</p>
<p>If you only want to change the font in your custom themes, it would be a little different. If you want help with that, attach a copy of the theme file and I'll help you modify it.</p>
<p>-Brett</p></div>Brett