Hello, I'm brand new to HTML
I'd be so grateful if somebody could help me out with this:
I'd like to include a picture on a webpage. if i save the picture as say cat.gif then should <img src="cat.gif" /> display the image?
or do i need to include where the image is saved?
and do i need the / at the end?
so grateful for help
if the image file is in the same diractory as that HTML page then it should work
mr chris
14-11-2006, 12:07
If you're using XHTML, you'll need the / to "self close" the tag - like using <br /> instead of <br>.
All tags in XHTML have to be opened and then closed in order to be valid code.
http://www.w3schools.com should be your next port of call.
DareToDream
14-11-2006, 12:07
Most people put their images in a folder called images, but you don't have to. It's just for convenience, so that all the images are in one place.
You could do it as you said. In Windows Explorer (if you're using it) you'd see pagewhatever.html, pagewhateversomethingelse.html, cat.gif and it would work.
If you put your cat.gif in a folder called images then the link would be <img src="images/cat.gif" />
If you're using XHTML, you'll need the / to "self close" the tag - like using <br /> instead of <br>.
Or indeed ...
<img src="cat.gif" />
As you originally did ;) :thumbsup:
thanks for this excellent help guys.
so if my image is saved in the same folder as the webpage is the destination would just be cat.gif and if i have an images folder in the folder that the webpage is the destination would be /images/cat.gif ?
the reference would be <img src="images/cat.gif" />