search

Home  >  Q&A  >  body text

css - How to control the img tag of textarea?

 <textarea class="content" style="width:650px;" name="content" required><p><img src="coverself/1497255947.png" /><img src="coverself/1497255744.png" /></p></textarea>

I want to use css to control all img tags in textarea and apply this syntax

.content p img
{
  height: auto;
  display: block;
  object-fit: cover;
  margin: 0 auto;
  max-width: 100%;
}

But no matter how I write it, he just ignores me. . . . What's wrong? ? ! Ask God

If this is the case

img
{
  height: auto;
  display: block;
  object-fit: cover;
  margin: 0 auto;
  max-width: 100%;
}

But some of my other imgs don’t want to do this

PS textarea uses html editor, what you see

仅有的幸福仅有的幸福2802 days ago931

reply all(3)I'll reply

  • 高洛峰

    高洛峰2017-06-13 09:25:23

    If possible, replace textarea with ordinary p, it will be much more convenient.

    reply
    0
  • 世界只因有你

    世界只因有你2017-06-13 09:25:23

    No pictures can be placed in textarea

    reply
    0
  • 黄舟

    黄舟2017-06-13 09:25:23

    Check the style of the browser console to see if it is overwritten by other weights, or the selector is not selected at all

    reply
    0
  • Cancelreply