• Resolved jeepindotcom

    (@jeepindotcom)


    Instead of just using: border=”1″, the new wysiwyg editor in 2.5 is now adding: style=”border: 1px solid black;” by default to my images when I edit their properties. It’s coming up with a border width of 1 in the image properties editor window too.

    Is there a way to turn off adding this css to the img tag? Or to turn off defaulting to a value of 1 in the border field?

Viewing 5 replies - 1 through 5 (of 5 total)
  • Moderator Samuel Wood (Otto)

    (@otto42)

    www.ads-software.com Admin

    It should default to empty, actually. It does for me. How are you adding these images?

    That’s interesting, you can actually see this as an inline style in your code? I would think the editor would not style an img tag at all so you could control it in your style sheet

    Thread Starter jeepindotcom

    (@jeepindotcom)

    mechx1, that’s what I would think too, but that’s not what’s happening.

    otto42, I’m editing existing existing entries/images. They do already have border=”1″ in the original HTML code though, so maybe that’s why the image property editor is defaulting to 1 in the border field.

    That still doesn’t explain why it’s inserting inline style code into the img tag though, that’s really what I don’t like about the situation. Also, it leaves the original ‘border=”1″‘ in the HTML code and inserts the additional style tag.

    For example, the original code looks like:
    <img src="uri/filename.jpg" border="1" alt="alt-txt-here" width="250" height="167" />

    After pulling up the image properties in the wysiwyg editor and clicking update, the code now looks like:
    <img style="border: 1px solid black;" src="uri/filename.jpg" border="1" alt="alt-txt-here" width="250" height="167" />

    Moderator Samuel Wood (Otto)

    (@otto42)

    www.ads-software.com Admin

    That’s interesting, you can actually see this as an inline style in your code? I would think the editor would not style an img tag at all so you could control it in your style sheet

    If you explicitly specify a border or width or whatever, then it will add it to the inline styles. If you leave it off, then it won’t add anything and will let your theme control it. The idea is that those things in the editor are overrides for normal styling, so this behavior makes sense in that respect.

    otto42, I’m editing existing existing entries/images. They do already have border=”1″ in the original HTML code though, so maybe that’s why the image property editor is defaulting to 1 in the border field.

    That’s correct.

    That still doesn’t explain why it’s inserting inline style code into the img tag though, that’s really what I don’t like about the situation.

    The new editor is designed to use styles instead of older, deprecated, things like “border” and such. It’s geared towards XHTML/CSS. The inline styles are intentional and by design.

    Also, it leaves the original ‘border=”1″‘ in the HTML code and inserts the additional style tag.

    Also by design, it usually doesn’t remove anything that it’s not set to actually change. It would mess with the styles, but it doesn’t change the border value, so it leaves it alone.

    Thread Starter jeepindotcom

    (@jeepindotcom)

    Makes sense.

    I do think though, that if it’s going to insert inline style code, it should at least give me options to set the other parameters for that style, ie: line type and color, vs always going with ‘solid black’.

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘2.5 wysiwyg editor adding: style=”border: 1px solid black;” to my images’ is closed to new replies.