HTML insert of image

User 193638 Photo


Registered User
557 posts

On my home page I want to insert a picture of one of my products. I used the following HTML code:

[[[<h2>Bonsai Tool Chest</h2>
<img border="0" src="/E:\WebPage\images\ToolChest1.JPG" alt="Bonsai Tool Chest" width="304" height="228" />]]]

In preview you can see the place holder for the image but the following paragraph of text after the image is run right up to the "butt" of the image (instead of a new paragraph as it was before I put in the image) and there are no longer any hard returns between paragraphs thereafter. I tried putting in some hard returns after the "]]]" but that did nothing.

What did I do wrong?
User 103173 Photo


VP of Software Development
0 posts

You will need to change that url because E:\WebPage\images\ToolChest1.JPG" will only be viewable locally. When you upload it, that will break. You should ALWAYS use an absolute URL to point to an image. Also, never use mixed case for a file name. Everything should ALWAYS be lower case.

[[[<h2>Bonsai Tool Chest</h2>
<img border="0" src="http://www.mydomain.com/images/toolchest1.jpg" alt="Bonsai Tool Chest" width="304" height="228" />]]]
Learn the essentials with these quick tips for Responsive Site Designer, Responsive Email Designer, Foundation Framer, and the new Bootstrap Builder. You'll be making awesome, code-free responsive websites and newsletters like a boss.
User 193638 Photo


Registered User
557 posts

Scott Swedorski wrote:
You will need to change that url because E:\WebPage\images\ToolChest1.JPG" will only be viewable locally. When you upload it, that will break. You should ALWAYS use an absolute URL to point to an image. Also, never use mixed case for a file name. Everything should ALWAYS be lower case.

[[[<h2>Bonsai Tool Chest</h2>
<img border="0" src="http://www.mydomain.com/images/toolchest1.jpg" alt="Bonsai Tool Chest" width="304" height="228" />]]]


I understand your point about E:\ drive being local but I have no server (host) yet so that is my reason for that. What is an absolute URL? As for lower case, I thought it had to be the same case as it is on my hard drive? If I use uppercase to label a file, don't I have to use uppercase in this case?

Wil your solutions cure my above stated problem?
User 364143 Photo


Guest
5,410 posts

Absolute file path
http://www.coffeecup.com/images/sccpro-home-kaboom.jpg
Relative file path
/images/sccpro-home-kaboom.jpg

CoffeeCup... Yeah, they are the best!
User 193638 Photo


Registered User
557 posts

Thank you Tom, makes since.

Can you answer my above question? Why no hard return after the image?
User 364143 Photo


Guest
5,410 posts

It doesn't matter if the files are on a local PC or the remote server if the file structure is the same.

If you use absolute paths, it won't work because obviously you won't have an E: drive or a C: drive on the server.

But you can have images/mypic.jpg exactly the same on both the local and remote computers, so use relative paths and make sure the file structure is the same.

1and1.com. $4 a month hosting to include domain. Problem solved. :)

CoffeeCup... Yeah, they are the best!
User 103173 Photo


VP of Software Development
0 posts

As to the file names. Windows does not see any difference between ToolChest1.JPG and toolchest1.jpg. However once you upload to your hosting account, ToolChest1.JPG and toolchest1.jpg will be considered two different files.

It is just code practice to always save everything in lower case. That way you always know exactly what the true file name is.
Learn the essentials with these quick tips for Responsive Site Designer, Responsive Email Designer, Foundation Framer, and the new Bootstrap Builder. You'll be making awesome, code-free responsive websites and newsletters like a boss.
User 193638 Photo


Registered User
557 posts

Steven Alford wrote:
On my home page I want to insert a picture of one of my products. I used the following HTML code:

[[[<h2>Bonsai Tool Chest</h2>
<img border="0" src="/E:\WebPage\images\ToolChest1.JPG" alt="Bonsai Tool Chest" width="304" height="228" />]]]

In preview you can see the place holder for the image but the following paragraph of text after the image is run right up to the "butt" of the image (instead of a new paragraph as it was before I put in the image) and there are no longer any hard returns between paragraphs thereafter. I tried putting in some hard returns after the "]]]" but that did nothing.

What did I do wrong?


OK, lets try this again.

I understand the absolute URL stuff, and the uppercase vs lowercase or mixed or whatever.

But none of this can be the answer to my question.

Why is the next paragraph AFTER the image I inserted right up against the tail end of the image?
Instead of the next line down.
User 103173 Photo


VP of Software Development
0 posts

You are moving into the rhealm of now needing to understand and how to use HTML. Take a look here at http://www.w3schools.com/tags/tag_div.asp

You need to wrap all of that inside of a div.
Learn the essentials with these quick tips for Responsive Site Designer, Responsive Email Designer, Foundation Framer, and the new Bootstrap Builder. You'll be making awesome, code-free responsive websites and newsletters like a boss.
User 193638 Photo


Registered User
557 posts

Please bare with me guys. I am not a computer programmer. :) I did as you said Scott and this is what I added:

[[[<div <p><h2>Bonsai Tool Chest</h2>
<img border="0" src="E:\WebPage\images\ToolChest1.JPG" alt="Bonsai Tool Chest" width="304" height="228" /></p></div>
]]]

I realize the E:\ drive is still there but the picture is on my hard draive and I need to see what it looks like in preview. When I get a host I will change it to my URL.

But this cured the problem, partly. The next paragraph went to the next line AFTER the picture--GOOD
But all the text after that is mashed together; there are no paragraph breaks.

Have something to add? We’d love to hear it!
You must have an account to participate. Please Sign In Here, then join the conversation.