Markdown中的内联CSS [英] Inline CSS in Markdown

查看:529
本文介绍了Markdown中的内联CSS的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我将Simplemde(markdown编辑器)用作嵌入的文本区域,用于在我的网站上撰写文章.我最近遇到了一个问题:

I'm using Simplemde ( markdown editor ) as an embdedded textarea for writing articles in my website. I've recently encountered a problem :

在写作时,如果我插入一张图片,它会延伸到100%,占据整个页面,就像这样:

While writing, if I insert an image , it stretches to 100%, taking over the entire page, like this :

我尝试在textarea中插入内联css(样式标签),但这没有用.

I tried inserting inline css (style tags) in the textarea, but that didn't work.

但是在预览选项中,我使用了内联css(将高度和宽度设置为400px)并且有效:

However in the preview option, I used inline css (set height and width at 400px ) and it worked :

如何在此降价编辑器中根据自己的喜好设置图像大小?

How can I set the image size as per my preference in this markdown editor ?

更新:我已经尝试将HTML嵌入Markdown中,例如:

UPDATE : I already tried embedding HTML in Markdown ,like :

<img style="width:400px;" src="abc.jpg">

但这似乎不起作用,而且我的图像甚至没有以这种方式出现在文章中.整个img标签在我的文本区域中缩小为<img>

But this doesn't seem to work, and my the image doesn't even appear in the article this way. The entire img tag gets shrinked to <img> in my textarea!

推荐答案

这也许可以回答您的问题,看起来您可以将HTML嵌入markdown中,并且可以以这种方式添加样式. 降价和图像对齐

This might be able to answer your question, it looks like you can embed HTML in markdown and you can add styles that way. Markdown and image alignment

您说您尝试过内联,是否只尝试过HTML?

You said you tried inline, did you try just HTML?

<img src="https://i.imgur.com/sZlktY7.png" width="50">

这篇关于Markdown中的内联CSS的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆