Can someone tell me the difference between these?

I couldnt tell the difference between the two lines of code.
<a href="" <img src=">< /a>

<a href="" img src=""> </a>

edit: got it thanks :thumbsup:

hoping it was a random bug or something with codepen… i dont think there is a real answer

I don’t know what you are asking here…were you trying to post code snippets to the forum?

You can follow this guide to do that:

i explained it the best i could… i was looking for a possible difference in the code. When i cut and pasted the 2 bits of code i was referring to… it just posted it as working code i.e the images(idk if the links worked i didnt try).

What i meant was… what i wrote looked like this

a href=“” <img src=“” /a

and it didnt work… so i looked up and old lesson to make sure i had things right and it showed this

a href="#" img src="# " /a

so i cut and pasted that… put in my href link and img… and that worked fine. Im just trying to figure out why it didnt work intially.

btw thanks for the link to forum code… still learning. i will use triple ticks next time. And i also realize i wasnt specifc on what i was talking about. Im in the process of making a portfolio page, thats where i was trying to insert the code.

Oh I think I get it.

You were trying to include this in your portfolio:

<a href="">
  <img src="">

But it wasn’t working, and then you cut and pasted the example:

<a href="#"><img src="#"></a>

And switched the # for actual links, and then it worked, but you don’t know why?

Without seeing the originals, it’s hard to say for certain why it happened, but it is pretty easy to sometimes accidentally write something like

<a href"=#">

and not noticed you’ve switched the quote and the equals no matter how many times you look at it…If the copy and paste fixed it, I’d guess it was some small invisible typo like that causing the issue :slight_smile:


yep! thanks for checking back in! Im still learning how to correctly communicate what im encountering.

re: your very first post[quote=“NerdBurglur, post:1, topic:62431”]

a href=“” <img src=“” /a

a href=“” img

src=“” /a
The difference between the two lines is:
first line: before img you have a “<”

PS - I’m new and surprised that it works without using opening and closing tags on the anchors <a><img src="#"></a>

It doesn’t work without the brackets on the tags, but the forum software strips HTML code, so the poster was trying to work around it. :slight_smile:

You could try reading your code backwards to check for small invisible typos. It is a trick writers use to check their papers for grammatical and spelling errors. Small errors seem to be the death of new coders.


When you write your message you can use the </> icon to the right of the quotation marks and it will show the ‘brackets’. { }, [ ], < > alternatively just use back ticks.

1 Like

When you write your message you can use the </> icon to the right of the quotation marks and it will show the ‘brackets’. { }, [ ], < > alternatively just use back ticks.