0

I am having trouble importing a properly working .gif file into Dreamweaver. I am in the process of learning how to code and in the meantime could really use some help with this. So far I have found the suggested code

<img src="image.gif" alt="image" />

Is this the best way to go about getting a .gif to appear and actually play when the page is opened ? Any and all help is very much appreciated.

4
Contributors
4
Replies
7
Views
5 Years
Discussion Span
Last Post by JorgeM
0

That HTML snippet is correct assuming the image is in the same folder as the HTML page. When you say you are having trouble, what exactly is going wrong? Is that code not showing the image?

0

Also keep in mind that when you copy your page up to the website, you also have to copy the image files. The file structure needs to remain the same. For example, if you have an image folder as a sub-folder of the root on your computer, that same structure needs to be established on the web server also so that the relative links aren't broken.

0

This is what I get just going to insert/image/and selecting the gif file

<img src="achievement113.gif" width="395" height="97" />

When I add the alt="image" the gif acts the same and the code looks like this

<img src="achievement113.gif" width="395" height="97" alt="image" />

And when I take away the size values the gif still acts the same and the code looks like this

<img src="achievement113.gif" alt="image" />

The only thing that I could think of is what hericles suggested, make sure you have imported/saved the .gif file into your website save folder (for instance mine is C:\Users\iDROID cpu1\Documents\Unnamed Site 2
This is where all of my files are saved for my website and when I upload the site to the server it pushes all of these files/folders to the website the exact way they are on my computer.

Hope this helps, I am pretty new to this to but trying to help :)

0

Just to add some information... with regard to the image attribute, the only requirement is the source attribute. The alt is good because it displays text when the image cannot be loaded and web spiders can index the text. The width and height, while not required, is a really good idea so that the web browser knows exactly what the dimensions are before downloading the image file from the web server.

In addition, it is good practice to have the image file the same size as the dimensions you indicate on the image element. Do not use huge image files and scale them down using a smaller height and width. If the image file is 2MB in size, that is what will be downloaded even if you only want to show the image of a size of 640 x 480.

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.