Skip to main content Link Search Menu Expand Document (external link)

Code tạo căn lề giữa cho ảnh trong bài viết sử dụng Markdown

TWIG
<div class="menu" style="text-align:justify;font-style:normal;padding:12px" id="content">
{{markdown(content)|raw}}
</div>
<script>
var img_in_content = document.getElementById("content").getElementsByTagName("img");
for (var i = 0; i < img_in_content.length; i++) {
img_in_content[i].style.display = "block";
img_in_content[i].style.margin = "0 auto";
img_in_content[i].style.borderRadius = "1%";
img_in_content[i].style.maxWidth = "70%";
img_in_content[i].style.maxHeight = "70%";
}
</script>

Chia sẻ



QRcode
QRcode