• I’m trying to add a style tag to an image, in the following way: <img src=”https://www.moonfireandsun.com/wp-content/uploads/2007/05/img-osteorsym.jpg&#8221; style=”floatleft” alt=”bend garden center” />. I’m using the WYSIWYG editor (the CODE tab) because I need my client to be able to edit pages (they don’t know any html). When I try to add the style element to the img tag, WP strips it out after I save the page. I’d like my client to be able to use some CSS for styling elements like images.

Viewing 4 replies - 1 through 4 (of 4 total)
  • I’d like my client to be able to use some CSS for styling elements like images.
    Then tell him to learn html and not to use the wysiwyg.
    You cannot add code into the wysiwyg. Period. That’s why it is called wysiwyg…

    If they use the wysiwyg they should to the img styling through that popup window you have there.

    Thread Starter duanelc

    (@duanelc)

    Understood. I was referring, though, to the “Code” tab within the WYSIWYG editor. It leads one to believe that you can edit HTML code there, but as I said, it strips out the addition of a style=”” element.

    Unfortunately, that’s a misleading gizmo, I know. I didn’t invent it that way…
    Indeed, it makes you think that switching to the Code will save you, but while the wysiwyg animal is active – it will kill all your code.

    Speaking of clients – if they are not knowledgeable… I just delete the whole wysiwyg thing, don’t even let them know it exists. Instead I make them several Quicktags they will use and everything works great ??

    Thread Starter duanelc

    (@duanelc)

    Great idea. Your help is much appreciated. Thanks!

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Adding style CSS to an image’ is closed to new replies.