How do I go about using a style sheet with wmd. Would like to see css formatting in the preview. Am opening minimalexample.html in Firefox under Windows XP. The style.css file is in the same directory where minimalexample.html is found. I have hopefully linked it correctly using the line below in angle brackets:

link rel="stylesheet" type="text/css" href="wmd.css" /

Thanks in advance.

1 answer

This was chosen as the best answer

If you mean this wmd then all you do is add css declarations for the elements produced by the editor.

e.g. in other words, whatever styles you have for <em> and <strong> will be used for italic and bold.

You could link an external stylesheet or you could just test with a style block in the head, like this:

<!DOCTYPE html>
    <title>WMD minimal example</title>
        <style type="text/css" media="screen">
            em {font-style: italic;}
            strong{font-weight: bold;}

        <textarea id="myTextarea" style="width: 500px; height: 200px;">*This* is a minimal example.</textarea>
    <div class="wmd-preview"></div>

    <script type="text/javascript" src="wmd/wmd.js""></script>


But I think the idea is to use the style sheet you have developed for your site, and ensure that has style declarations for all elements that wmd can set.

Answered almost 8 years ago by Tony Crockford