[英]custom CSS in shiny box
我正在嘗試創建一個box
,其中包含左上角的標題和右上角的小圖標。 HTML
看起來像這樣:
<div class="box-header">
<h3 class="box-title">TOTAL DAY</h3>
<img class="box-title" src="https://www.gravatar.com/avatar/4ab40c688a7362255373fc5f185b9698?s=48&d=identicon&r=PG&f=1">
</div>
具有以下css
更改:
.box-header .box-title{
width: 50%;
float: left;
}
img{
object-fit: contain;
object-position: right;
height: 2vh;
}
結果看起來像這樣:
添加css
很容易,但是有沒有辦法在shiny
中添加這樣的<img>
?
有點解決了我自己的問題..哎呀
我在box
function 中使用了這個:
title = HTML("<h3 class=box-title>TOTAL DAY</h3><img class=box-title src=https://www.gravatar.com/avatar/4ab40c688a7362255373fc5f185b9698?s=48&d=identicon&r=PG&f=1></img>")
將HTML
包裝在HTML()
function 中允許shiny
讀取HTML
作為代碼而不是字符
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.