Twitist Forums
How to insert an image in html using brackets? - Printable Version

+- Twitist Forums (http://twitist.com)
+-- Forum: Twitter forums (/forum-1.html)
+--- Forum: Twitter General help (/forum-6.html)
+--- Thread: How to insert an image in html using brackets? (/thread-158416.html)



How to insert an image in html using brackets? - Eleanor - 05-22-2014 10:00 AM

I am using the programme brackets as i am on a mac. I am trying to insert an image, i am teaching myself html off a tutorial online but the tutorial is using an older form of html is assume?
I have tried

<img src="twitter.jpg"> and it isn't showing anything when i save the doc and try to view it, what am i doing wrong?


- Jordan - 05-22-2014 10:06 AM

Aren&#x27;t you supposed to have the &lt;&#x2F;img&gt; at the end? Or is that only for headers and body etc.?


- Franco - 05-22-2014 10:12 AM

Hello

The picture should be with the web page, and the part where it says .jpg in the html img tag must match the picture's file extension. The name twitter must be spelled the same way as the picture's file name.

You have to save the web page like .html


- Alfie - 05-22-2014 10:24 AM

you need the full path to where the image is stored. If it's in the same folder as the html file then your code should work but lets say it's in a folder called 'images' and the images folder is in the same folder as the html file it would be
<img src="images/twitter.jpg" /> (note the forward slash before the closing '>'
You should aslo include the width and height of the image and an alt tag to describe it.

Assuming the twitter image is 20 pixels square your code would be
<img src="images/twitter.jpg" width="20" height="20" alt="Twitter Icon" />

You could also add a title tag and a class to the image if you wanted to


- Santos - 05-22-2014 10:40 AM

<img src="twitter\picturename.jpg">
try this way