The background page isn't displaying - html

I have put the path as you can see but when I load this code on my site it actually doesn't display the background for some unknown reason.
Here is what I see on the site :

please try using the relative path like this: "../images/page-background.png"
regards,

It looks like your background-image-url line is pointing to the following directory. root/resources/styles/Webstar-Website/resources/images/page-background.png
Instead you'll want to use this url. ./images/page-background.png
In CSS all directories that you use are relative to the location of the file you are editing. If you were to move your CSS file, you would have to rewrite the directories.

background-image: (images/page-background.png);

You can use absolute path to be sure, and clear you cache
background-image:url("http://www.site.ext/Webstar-Website/resources/images/page-background.png");

It's look your URL is wrong, try this
background-image : url("http://yourwebsitedomain/resources/images/page-background.png") ;
Or you can using relative path instead to call the image
background-image : url("../images/page-background.png") ;

add a \ before your address
it refers to root of the structure you choose for the project

Related

How do I get the relative file path of an image or video?

Each time I try to add an image to visual studio code I keep having to inspect and get the entire image source code.
I would like to just use /images/down-chevron.png.
Any help?
Thanks!
Example of my code:
<img src="file:///C:/Users/tashe/Downloads/CODING%20CAGES/Cleant%20Dental%20services/images/up-chevron.png" id="upArrow" onclick="upArrow()">
<img src="file:///C:/Users/tashe/Downloads/CODING%20CAGES/Cleant%20Dental%20services/images/down-chevron.png" id="downArrow" onclick="downArrow(
</div>
You're almost there. Just replace the "file:///C:/Users/tashe/Downloads/CODING%20CAGES/Cleant%20Dental%20services" with a dot from the src attribute and you'll be good to go.
<img src="./images/down-chevron.png" >
In VS Code, depending on your autocomplete settings, each time you write src, should give you options for autocomplete including the images folder.
You could store the images you'd like to use in a folder called img inside of the folder where your HTML and css live. Then for the img tag in the HTML you could use something like
<img src="./img/down-chevron.png">
The ./ lets you navigate through the working tree. Using ../ would go back two directories if needed.

background image works in body tag but not in css

I tried and searched a lot but I couldn't find an answer to my problem.
When I write in my html file like:
<body background="images/background/123.jpg">
The background image is shown but when I write the following code in the CSS file it's not:
body {
background-image: url("../images/background/123.jpg");
}
Other settings to the image made in CSS do work.
Does anyone has an idea why it is not working in CSS?
Thank you a lot.
try this one:
background-image:url("../images/background/123.jpg");
Assuming the HTML file and the CSS file are in the same directory.
The CSS version had a path "images/background/123.JPG"
But the HTML tag version has a path "../images/background/123.JPG"
Considering nothing is wrong with the syntax here, the problem here is definitely the path
Try
background-image:url("images/background/123.JPG");

Is it possible to link up more than one step with relative paths?

Here is an example of what I'm looking to do:
Link from a page with the path http://mysite.com/lorem/ipsum/ to http://mywebsite.com/ using a relative path.
My first thought was to use this: <a href='.../'>link</a>. But this ends up giving me http://mysite/lorem/ipsum/.../.
Is there a way to do this without calling the actual URL?
How about
link
:)

html correct link path to another directory within <a href> tag

Supppose you are here http://domain.com/category/month/123.
What's the correct way to put a link to http://domain.com/category on that page?
Is ... a proper way to do that? It works, but I'm not sure if this is correct and the best way.
Thank you.
One of:
../
/category
//domain.com/category
http://domain.com/category
You shouldn't use /../category as the logic for that is "Start at the top, then go up a level, wait there is no level … ignore that bit then, then go to category".
you can use "/category", the domain will be added automatically.
Link
You could use an absolute path as follows:
link

How src of img should look like

How do I display an image which is located outside the context root.
i.e the image is located in <jboss_root_folder>/images/myImage.jpg .
How the src of img tag should look like in such case?
Any lead in this regard will be of great help.
The below line works in a html file : <img src="file:///G:/DevEnv/jboss-5.1.0.GA/images/DSCN0968.jpg"> where as the same line from my xhtml does not work when accessed from server
Regards,
Satya
You can either give the full url i.e. http://www.example.com/root/images/myImage.jpg or use relative paths i.e. if root is two levels down from the page location: ../../image/myImage.jpg. For an example, see this page.