0

I am having a very strange problem with HTML.

On my backend, the problem part is like this.

        <div class="content">
            <a href="detail.html"></a>
            <img src="assets/img/tmp/img.png" alt=""></img>
        </div><!-- /.content -->

On the brower(Google chrome) view source

        <div class="content">
            <a href="detail.html"/>
            <img src="assets/img/tmp/img.png" alt=""></img>

        </div><!-- /.content -->

but when inspect element

        <div class="content">
            <a href="detail.html">
            <img src="assets/img/tmp/img.png" alt=""></img></a>

        </div><!-- /.content -->

as you can see the tag is interpreted differently, and it caused a lot of problems, any ideas why this happens? but when i add <a href="detail.html">><!-- required for FF3 and Opera --></a> in backend the problem solves.However, instead of put this everywhere, is there any other way i can solve it

I am using apache tile in spring mvc with html header like below

<jsp:output doctype-root-element="HTML"     doctype-system="about:legacy-compat" />
Community
  • 1
  • 1
Grey
  • 1,365
  • 4
  • 23
  • 34
  • Are you saying a structure like `` gets transferred as ``? Yes, that is not good. Unless the page is served up with an xml MIME type. In HMTL, `` is just a start tag with an error in it. – Mr Lister Oct 07 '13 at 09:48
  • yes, that's what is happening, it got collapsed. is there a way i can disable it? – Grey Oct 07 '13 at 13:30

1 Answers1

0

I found the problem. the template file i wrote using the jspx extension, where i should use jsp instead. i thought the extension doesnt really matter, since tiles will compile the file regardless the extension. Hope it could help others to fish out the same issues :)

Grey
  • 1,365
  • 4
  • 23
  • 34