WebSite X5Help Center

 
Ryan M.
Ryan M.
User

HTML insert image  en

Автор: Ryan M.
Просмотрено 4132, Подписчики 1, Размещенный 0  

How can I add an image into the website builder while using HTML/CSS code?

I have no issue with using the insert image object however I want to use CSS to add a text overlay to the image and with my understanding it requires html to call the image and then CSS to put text on top of the image.  I see no way of doing this without coding the object manually it in the program.

I cannot figure out where the image needs to be saved and how to reference the image location in the html code properly.

I expect to be able to do this properly in preview mode and for it to also work once it all has been uploaded.

Размещено
5 Ответы - 1 Полезно - 1 Корректно
John S.
John S.
User

Hello Ryan

You could take a look here : http://www.energifremtiden.dk/c4d/accordion-3---copy.html

Here I have 2 HTML-objects - one to the left and one to the right.

In the left html-object I have the image that is "mapped".

In the right object I have an accordion. You can see the HTML-code for the "little-mermaid" accordion item.

<div class="tab">
<input id="tab-one" type="checkbox" name="tabs">
<label for="tab-one"><img src="http://www.energifremtiden.dk/c4d/materiale/copenhagen_havfrue.jpg" height=43 onclick="window.open('http://www.visitdenmark.com/denmark/little-mermaid-gdk586951','popup','width600,height840'); return false;" onmouseover="doThis('rm1');return false;" onmouseout="UndoThis('rm1');return false;" align="left">The Little Mermaid</label>
<div class="tab-content">
<img src="http://www.energifremtiden.dk/c4d/materiale/copenhagenim_mermaid.jpg" align="left" height=150" onmouseover="this.height=300;" onmouseout="this.height=150;">
<p>At Langelinje Pier you will find one of Copenhagen's most famous tourist attractions: The sculpture of The Little Mermaid. 23 August 2013 she turned 100 years old.</p>
<p>Unveiled on 23 August 1913, The Little Mermaid was a gift from Danish brewer Carl Jacobsen to the City of Copenhagen.</p>
<p>The sculpture is made of bronze and granite and was inspired by Hans Christian Andersen’s fairy tale about a mermaid who gives up everything to be united with a young, handsome prince on land.</p>
</div>
</div>

This is to show how I put an image in the accordion and what happens when hovering the image and clicking the image.

You have to "manually" upload the images via FTP, to your site. As you see, I use full path to the images - the right thing is to use relative path.

I would advice you, to study some on the internet. The w3schools.com is a good place to visit.

https://www.w3schools.com/html/html_images.asp

I hope this helps you a little.

Kind regards

John S.

Читать больше
Размещено От John S.
John S.
John S.
User

Hello again

The built-in image object also have the possibility to show text - when hovering and when clicking.

You can see an example here : http://www.brammingegnsmuseum.dk/pionertiden.html

Try to hover one of the images and evt. click on an image.

This is made without use of html and CSS. Only the image-object is used. This site is made in ver. 12.

Kind regards

John S.

Читать больше
Размещено От John S.
Ryan M.
Ryan M.
User
Автор

Hi John,

I truely appreciate the reply and offering me some advice.

I have some experience with web developement and understand most of the fundamentals that I might get from w3 schools.  I remember being on that web page back in high school about 13 years ago. I know much has updated since  then but I do feel like I understand most of the philosophy behind web development.... Hopefully.....

Where I may be a little confuse is with using the preview function within the program on my PC before uploading the website before once it is completed.  I currently am using a hosted service with their template that I would like to replace once my replacement is ready to go live.

Where this puts me is how do I use my own cache of images while still using the manual html object.  So for instance if I manually enter the code "<img src="c:\images\image.jpg"> I would like to use the source location the same way the program does when you use the image object and upload a local image.  Where does it put these images locally to be uploaded for that object?  Can I reference them in my manual html code the same way the program does for the preview but will also keep the reference intact once the ftp upload has been completed?

I am using the manual html code to be able to take advanted of text overlay on images using CSS.  You can see the template I am currently using my site.  On the homepage you will see an image with text always overlayed on top of the image using CSS withouse mousing over or anything like that.  I am essentially trying to recreate that idea.  I can get the text to show just fine but the local (and soon to be hosted) image reference has me confused. website - https://www.murphtechllc.com/

I would like ]the upload to be as seamless as possible without having to go back and fix things when I am ready to make the switch.

Thank you for the reply.  Hopefully I explained what I am trying to do a little better.

Ryan

Читать больше
Размещено От Ryan M.
Esahc ..
Esahc ..
Moderator

Ryan

To call an image using html code you need to drop the local path

Instead of "<img src="c:\images\image.jpg">

use

"<img src="image.jpg">

Then simply make sure there is a copy of image.jpg in the preview directory (so you can preview locally) and when online, the root directory of your site where all pages are loaded.

I do this on my site for one image, but have found I must use filezilla or similar to put the image on the server (at least initially).

You can of course place the image/s in a directory if you wish (eg "images\image.jpg"), but referencing your local drive will not work when online.

Читать больше
Размещено От Esahc ..
Ryan M.
Ryan M.
User
Автор

I think the preview directory is what I was missing.  Thank you.

Читать больше
Размещено От Ryan M.