Images showing up as background but not as img src - html

This is my first post so please bear with me.
I am working on a WordPress site and came across a problem with my images.
I have a background image in my stylesheet
background-image: "images/dummybg.jpg"
and that works just fine and shows up
When i go to the index file and try
<img src="images/dummybg.jpg">
the image does not show up.
Both the .css and index.php are loose in my folder so their relative paths SHOULD be the same. So my question is, why would one path work and not the other?

WordPress has a function to get to your image directory
So from your index it would be:
<img src="<?php bloginfo('template_url'); ?>/images/dummybg.jpg">

Have you used image in css. it's automatic get image path.
but if you used in any other file in tag you have must need put whole image path in src attribute.
you need to put current theme path in bellow wordpress function you will get.
get_template_directory();
if you need more details please visit
wordpress functions
I am sure it's work for you.

Related

Cant get image to display in subpage: HTML

Alright, so I have been attempting to get an image to display in one of my subpages in HTML. I am sure that this is a very simple and stupid issue in regards to how I am referencing the image in the code. The image file is called crab.jpg and it is inside the pics folder which is all contained in the Websites folder. I have no problems with similar code displaying images within the index file which is the main page for the website.
<img src="Websites/pics/crab.jpg"
width="400"
height="400"/>
Not sure if this will work, unless it's in a subfolder. But try adding /
before the Websites
if that doesn't work try ../
and if that doesn't work try ../../

Image broken - how do I display using HTML and Filezilla

I need help. I am VERY new to learning HTML. I created a very basic / practice HTML file; this is all I have learned so far. I want to display an image but the image will not display. I am using FileZilla to upload my webpage. On my desktop I have my project folder with my index file inside and another folder called images. I uploaded this to FileZilla and uploaded again there. Not working; need help! I really need simple precise answers as I am very very new. Thank you!
Below is my desktop, Filezilla, my html and my page
My desktop folder
Filezilla
My HTML
My Webpage
You need to find the position you want to place the image in the index file. Then you can use the image tag. As the image is in a subfolder that's why you need to write the image tag like this
<img src="/images/example.jpg" alt="Testing" width="600" height="400">
Here you can remove the height and width if you want also reshape the image size by changing height and width

Adding an image to HTML

I'm trying to add an image, but it only shows up as a corrupted or unloaded image(I'm not sure what to call it, it's a tiny picture of a broken picture..? lol) here is my code....
<img src="funny_alien_01.jpg05e9a40c-bb67-46e2-a106-ac097b47bd28Original.jpg">
I've tried this with an image from placeholder and that works fine, I'm wondering how to use an image off of google images or an image saved to my PC. Thanks.
Check you image source link
Give a readable image name. Like: 1.jpg or 1.png
The path to the image in your example looks invalid.
To display an image from the web, you’ll need to use an absolute path:
<img src="https://www.example.com/images/dinosaur.jpg">
Notice how the path starts with https://
Check out this resource on how to use the image tag for displaying images from the web, or from your computer:
https://developer.mozilla.org/en-US/docs/Learn/HTML/Multimedia_and_embedding/Images_in_HTML

Why won't my image display despite correct src address? [html]

i'm new to html and css and i've decided to utilise my time spent commuting by doing a little coding on the go. As such, i've started a practice project using Droidedit for android, on my Galaxy S7, but now i've hit a bit of a head-scratcher. Attached images below:
With full URL code and result with full URL
With relative URL code and result with relative URL
Not sure where i've gone wrong here. The image is in the same directory as the html file.
Thanks in advance peeps!
You don't need that last "/" at the end after the jpg
I guess there could be an issue with path used to show the image. Instead of following
<img src="internal storage/download/htmlearning/jotpage1.jpg/" ...
try
<img src="jotpage1.jpg" ...
since your HTML file and image file are at same folder

Images inside WebContent are not shown in html page

I read adding image to eclipse web project which should be the same problem as I do.
But the solution is not working for me.
I also have the same folder called images inside WebContent, and i have a jpg image inside it. And in the html web page, i use <img src="images/qrcode.jpg" /> . The page does not show the image, I also tried, <img src="/images/qrcode.jpg" /> <img src="../images/qrcode.jpg" /> but they not work either.
Can any body help me with this?
PS: I use the below code to to go to my page(wodinow is the project name, the html is inside the folder of pages)
response.sendRedirect("/wodinow/pages/userhelp.html");
have you checked given extension is correct? may be JPEG, jpeg. If nothing is work post your folder structure.