Question

I want to use a framed box in a Markdown document (actually I use RMarkdown with RStudio and knitr). I write the following css in the Markdown document:

<head>
<style>
.title_box { 
  display: block;
  border: 1px dotted darkRed; 
  border-radius: 50px;
    width: 90%;
    background-color: white;
    left: 60px;
    position: relative;
    margin-top: 60px;
}
.title_box #title { 
    border: 1px dotted darkRed;
    border-radius: 10px;
  position: relative; 
    padding: 5px 5px 5px 5px;
  top: -0.5em;
  margin-left: 2em;
  display: inline; 
  background-color: seaShell; 
    font-family: Calibri;
    color: darkRed;
    font-style:italic;
}
.title_box #content {
    padding: 5px 25px 25px 25px;
    line-height: 28px;
    color: darkRed;
    font-family: Georgia,'Comic Sans';
    font-style:italic;
}
</style>
</head>

And then I use it as follows:

<div class="title_box">
    <div id="title" style="color:blue">Write title here</div>
    <div id="content">
        Write body **here**
    </div>
</div>

which gives:

enter image description here

As you can see, the markdown language does not work in the box ("here" appears between double asterisks instaed of appearing in bold font). Is there a way to make it work ?

Was it helpful?

Solution

When sample code was pasted into RStudio with Windows 7 and knitted with knitr, it properly bolded the word "here". The cut and paste process left a tab before the start of the second section of code (before the line starting with div class="title_box"). When tab was removed, it produced the text with asterisks. Returned tab before the div line and it bolded properly.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top