Skip to main content
Participating Frequently
June 19, 2017
Answered

insert image tag in HTML 5 explicitly closed

  • June 19, 2017
  • 2 replies
  • 491 views

Using Dreamweaver CC2017's "Insert" > "Image" results in an image tag code that includes a forward slash in front of the closing angle bracket. I'm working in html5 and don't wish to have the forward slash.

EXAMPLE:

DW generated code: <img src="photo.jpg" width="200" height="200" alt=""/>

Desired code: <img src="photo.jpg" width="200" height="200" alt="">

Is there a preference I can change so Dreamweaver won't include the forward slash?

    This topic has been closed for replies.
    Correct answer ALsp

    Adobe was informed of this a very long time ago. For some reason they have not fixed it. The incorrect syntax will not cause any harm to your page, but it is unseemly :-)

    We made our own insert image utility for our main page building extension, and are about to make one for our Flexbox page building tool. Perhaps we can make it a general tool so that all Dreamweaver users can take advantage of it.

    2 replies

    Nancy OShea
    Community Expert
    Community Expert
    June 19, 2017

    I mainly work in Code view with code hinting so it's no problem for me.   If self-closing tags bother you, just remove the slash.   As Al said, it doesn't matter to the browsers either way.

    Nancy

    Nancy O'Shea— Product User & Community Expert
    ALsp
    ALspCorrect answer
    Legend
    June 19, 2017

    Adobe was informed of this a very long time ago. For some reason they have not fixed it. The incorrect syntax will not cause any harm to your page, but it is unseemly :-)

    We made our own insert image utility for our main page building extension, and are about to make one for our Flexbox page building tool. Perhaps we can make it a general tool so that all Dreamweaver users can take advantage of it.

    Participating Frequently
    June 19, 2017

    I understand the syntax will still validate, but as Al stated, it is unseemly (and I feel should be updated).

    Nancy, for me the self-closing tag (with a slash) is generated even in code view. With code hinting I have the option of allowing tags to self-close or not. I prefer self-close as a general rule, but I guess in this instance it doesn't work well (for my needs).

    Al, I was unaware of the Project Seven page building extension (LBM) image insert feature. Just discovered it on right click and it works perfectly! Like your idea of offering it as a "general tool" as that would be great when updating older sites with older site structures.

    Thanks to both of you for your feedback!