繁体   English   中英

编织器,转换为base64和CSS样式

[英]Knitr, convert to base64 and CSS style

对于这个很棒的库(和HTML),我是一个新手,所以这可能是一个菜鸟问题。

我有一种无法解决的情况-如何在图像中添加一些CSS样式,同时也在base64中对其进行编码? 这是我的Rmarkdown文件(我传递给knit2html )中的代码-

<img src="SomeImage.png", width = "75%", border = "2"> # converts to base64 with width and border correctly applied
<img class="displayed", src="SomeImage.png"> # does not convert to base64, points to local path with style correctly applied

有没有办法在应用样式的同时将第二个转换为base64? 还是我做错了什么?

SessionInfo ,如果需要-

> sessionInfo()
R version 3.0.2 (2013-09-25)
Platform: x86_64-w64-mingw32/x64 (64-bit)

other attached packages:
 [1] markdown_0.6.5   xtable_1.7-1     knitr_1.5        audio_0.1-4      ggplot2_0.9.3.1 
 [6] scales_0.2.3     stringr_0.6.2    reshape2_1.2.2   reshape_0.8.4    plyr_1.8        
[11] data.table_1.9.2

谢谢!

尝试这个:

<style>
.displayed { border: solid 1px; }
</style>

<img src="Rplot001.png" class="displayed">

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM