img tag not working in drupal content - html

I tried to use <img src="sites/all/themes/bluez/images/team/zin.png"> in drupal content. But, it doesn't working properly. I also choose Full HTML in text format.
The image only show blank screen and when I click the image url, it says
Not Found
The requested URL "/planz/node/sites/all/themes/bluez/images/team/zin.png" was not found on this server.
Please help my problem. I'm new to Drupal.
Thanks.

Try to make the target path absolute.
Visit the absolute path from your browser - There you can easily see if you have the correct path or not! When you have the correct path, than you can insert that to your code!

Related

HTML image not displaying even though the path in the img tag is correct

I am trying to display an image in my Angular project using HTML. The code is shown below
<img src="../../../../../Uploads/1640665063123--hc-Freeport.jpg" alt="Test">
I have verified that the link is correct. The file type is also correct. Additionally, the image has not been corrupted in any way since I can open it in Photos, Visual Studio Code, and Google Chrome. However, the image does not load in HTML. Instead, the "Test" text is shown. Can anyone give me some advice? Am I missing something?
The links below show the structure of my project. The second link shows the file in which the home-page component is located, which is where the image is supposed to be displayed.
https://ibb.co/Qj8HZy5
https://ibb.co/4JSk8g2
Try putting the image file in assest folder and use this path,
<img src="assets/Uploads/1640665063123--hc-Freeport.jpg" alt="Test">
I have had this problem before when making a website. Try to use the full path from the root or maybe try to use a different text editor or browser.

Images won't load as css background

enter image description here
I am trying to make a full page background image when the site loads. The problem is, none of the images i tried wont' load.
I checked my code syntax, checked the image format, checked my path to image folder, everything seems to be fine but images still won't load.
CSS:
.header-nav-menu{
background-image: url("../project/full.jpg");
}
I am not getting any error messages so I can't figure out where is the problem.
Try referencing the image at root level. Like this:
.header-nav-menu{
background-image: url("/project/full.jpg");
}
You should also be able to check the file path with your code editor, if it redirects to the image then the path is good and syntax are good. Check if you uploaded your img correctly to the server if you are using one, otherwise put it directly at the root as said below, it can't be messing for a lot of possibilities.
You should try your browser's development tools to investigate. (F12 on Chrome). You can see if the image section is present in the page. Try using a full path, rather than a relative one to see if that gives you anything. Also it could be a permissions issue where the folder containing the images is not accessible.
.header-nav-menu {
background-image: url('full.jpg');
}
Read up on pathing: Difference between Relative path and absolute path in javascript

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

HTML Relative Path Not Showing Image

I have a URL to this link
http://www.weebly.com/editor/uploads/8/5/0/1/85017748/custom_themes/762476756986669176/files/img/home22.jpg
I am trying to use a relative path instead of an actual url. For some reason when I do this
<div class="background-image-holder">
<img alt="image" class="background-image" src="files/img/home22.jpg">
</div>
The image doesn't show, but when I use a url it shows just fine. Any ideas on what I am doing wrong? I've also tried ../files/img/home22.jpg and img/home22.jpg but neither worked.
Clearly you have a problem with your relative path, the easiet solution to fix this, is to inspect your html code and see what is the path set after that you can figure out which part of the URL you are missing. We can't really help you with the exact relative path you need, because we don't know which system CMS or Framework you are using ..
To inspect your HTML code, open your website in google chrome or firefox (you can use firebug) and right click => Inspect Element

QTextBrowser doesn´t display image from html file (Windows 7)

I´m using a QTextBrowser to display an external html document (and its image resources) which is placed in the same directory as the application. Everything works fine exept that images are not displayed properly. Instead of the actual picture there is a "missing image" icon.
Using Ubuntu 12.04 I didn´t have this problem but in Windows 7 it does not work as expected (which I described before).
I tried different image formats and Qt versions, without success.
If I type in the absolute file path of the image it is displayed fine. But that´s not what I´d like to do as I can´t share my application then.
This is the part which loads the html file into the textbrowser:
QFile file(QApplication::applicationDirPath().append("/test.html"));
if(!file.open(QIODevice::ReadWrite|QIODevice::Text))
return;
QTextStream in(&file);
ui->textBrowser->setHtml(in.readAll());
file.close();
And this is my html document:
<!doctype html>
<html>
<img src="test.png">
<p>paragraph which contains some text</p>
</html>
Does anybody has an idea why it doesn´t display the image?
Thanks in advance,
Peter
I would say that the image path is simply incorrect because its currently relative but you're having to address the HTML file as absolute.
To test, try using an absolute URL on your image src to see if it works. You could try using one from the internet then try one on your local file system.
If they both work with absolute URLs, then you'll just need to look into getting the correct file path into your HTML document.
I hope this helps you to debug the problem. Sorry I don't have a precise answer, I'm also new to QT.