-1

The issue is that I can't get this banner to post into my blog, and the error message is what's in the subject. I am trying to update a template with this. I don't see any missing ; but i've made sillier mistakes today so who knows.

<div> id="RightFloatAds;" style="right: 0px; position: fixed; text-align: center; top: 65px; background-color:black;color:black;border:5px; solid; black;"><a target="_blank" href="http://www.ramycapital.ca/?p=subscribe&id=1"><img src="banner1news.png" width="160" height="725" alt=""><div/>
vanowm
  • 9,466
  • 2
  • 21
  • 37
Oswald
  • 9
  • 4
  • My original code was '''
    '''
    – Oswald Jul 15 '21 at 23:17
  • Replace `&` with `&`. – Progman Jul 15 '21 at 23:17
  • I think that is it, thanks – Oswald Jul 15 '21 at 23:22
  • Now the error is "org.xml.sax.SAXParseException; lineNumber: 4655; columnNumber: 291; The element type "img" must be terminated by the matching end-tag "". '''
    ''' When i take the obvios step of adding the missing image tag, the next error is, "a" must be terminated by the matching end-tag ""
    – Oswald Jul 15 '21 at 23:28
  • Every tag you open must be closed as well. So when you write `` to mark the start you have to write `` to mark the end. The parser you are using is telling you, that you have not done that for that specific tag, but instead wrote something else. Recheck the code you have that the start- and end-tags match. You might want to use special "empty tags" for tags which do not have a body per se, like the `` tag. – Progman Jul 15 '21 at 23:36
  • Ok so now i got that all fixed and no errors, but when i upload it, the image is visible but not hyperlinked. – Oswald Jul 16 '21 at 01:10

3 Answers3

0

Your html has so many issues...

First of all, attributes of HTML elements must be after element's name and before >: <div id="blah" otherattribute="value">

Second, there is no ; allowed in attribute ID.

Third, you are missing </a> and instead of closing </div> you have invalid </div>

And finally try avoid use inline styles, use CSS instead if all possible of course.

<div id="RightFloatAds" style="right: 0px; position: fixed; text-align: center; top: 65px; background-color:black;color:black;border:5px solid black;">
  <a target="_blank" href="http://www.ramycapital.ca/?p=subscribe&amp;id=1"><img src="banner1news.png" width="160" height="725" alt=""></a>
</div>
vanowm
  • 9,466
  • 2
  • 21
  • 37
  • Removing the as well as changing that were both also foolhardy attempts at fixing this. I should have been more descriptive in my question of what i have tried. – Oswald Jul 15 '21 at 23:15
  • How about you post the original code and also give information what exactly gives you the error. Is this the only line you trying to post? – vanowm Jul 15 '21 at 23:18
  • '''
    ''' original code
    – Oswald Jul 15 '21 at 23:20
  • Yes it is the only line i am trying to post. Everything else works. org.xml.sax.SAXParseException; lineNumber: 4655; columnNumber: 223; The reference to entity "id" must end with the ';' delimiter. – Oswald Jul 15 '21 at 23:21
  • I've update the answer, perhaps the error comes from `&` in the href, it should be escaped: `&` – vanowm Jul 15 '21 at 23:23
  • Thanks, but it still isn't working. Its giving this error to your solution. org.xml.sax.SAXParseException; lineNumber: 4656; columnNumber: 138; The element type "img" must be terminated by the matching end-tag "". – Oswald Jul 15 '21 at 23:43
  • "Unlike paragraph, header, or list tags, the image tag doesn't require a closing tag." I don't know what that error is about. In any case, make it happy by adding `` before `` or add `/` before `>` – vanowm Jul 15 '21 at 23:49
  • I fixed that error, and i was able to get it accepted without any errors. However, the banner shows up but without it's link. """"
    """"
    – Oswald Jul 16 '21 at 00:00
  • It looks fine, must be your blog messing with you...try use devtools to make sure the link actually is missing. p.s. use `` when posting inline code here – vanowm Jul 16 '21 at 00:03
  • I used devtools as you suggested and the link is there. It's not missing. Any idea how to solve that? – Oswald Jul 16 '21 at 00:34
  • If the link is there, there is nothing to fix... – vanowm Jul 16 '21 at 00:50
0

I've answered my own question by changing the format of the img src. After making these changes, there is no longer an error.

'''' ''''

Oswald
  • 9
  • 4
-1

remove the semi-colon from your id (;)

raderp
  • 11
  • 2