WordPress.org

Ready to get started?Download WordPress

Forums

Adding style CSS to an image (5 posts)

  1. duanelc
    Member
    Posted 7 years ago #

    I'm trying to add a style tag to an image, in the following way: <img src="http://www.moonfireandsun.com/wp-content/uploads/2007/05/img-osteorsym.jpg" 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.

  2. moshu
    Member
    Posted 7 years ago #

    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.

  3. duanelc
    Member
    Posted 7 years ago #

    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.

  4. moshu
    Member
    Posted 7 years ago #

    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 :)

  5. duanelc
    Member
    Posted 7 years ago #

    Great idea. Your help is much appreciated. Thanks!

Topic Closed

This topic has been closed to new replies.

About this Topic