How can find the image path for css - html

I am new for for css and Bootstrap so sorry if silly question.
I want to use the Bootstrap in my project. I found a tutorial and going to follow. In the tutorial There is a folder and when I run the index.html file then you can see page with the logo.
I am trying to use the bootstrap and css in my project. I tried make same in my project with main.phtml
I run my file first and I could not see the logo(image) and I was thinking the problem is the path of .css file
The problem is when I put my html file in any directory rather than under main project(no any directory) I cannot see the logo.
Below first two screenshot is the tutorial file screenshots and the second two screenshot is the my file screenshots.
(I did not share any code because the css and html files are working)
Can someone explain to me why we cannot use the html files in directory or if yes how can we manage?
but when I try to add my project I cannot see the logo.
and the view;
EDIT

Please check here:
https://stackoverflow.com/a/20047417/6284581
you do not have to move your .html file
Your example css and img path not state correctly.
../ means one file directory up(check link above)! In your example if you start from
web... then you need to go main project directory. Try this
<link href="../web/static/styles/style.css" rel="stylesheet">
<a class="navbar-brand" href="#"><img src="../web/static/style/img/logo.png"></a>
I hope it will help to you

Related

Linking CSS to HTML

enter image description herefirst time posting here. I restructured all the files on my website since I wanted to experiment with how to organize files, and I ran into a few issues. When I launch the site HTML appears but the CSS stylesheet doesn't seem to want to attach. I also think the js sheet is also not attaching properly but can't test it till css shows up. I double-checked spelling as well as placed the index.html on the root folder but still nothing I'll post the code below and hopefully someone can help me out. I appreciate you guys.
When you link a CSS or JS file to an HTML file, you need to provide a relative path from the HTML file to the CSS or JS file. In this case, it looks like index.html is already in the Root directory, so you shouldn't include that in the CSS file paths. The relative path to the css files (the path from the directory where index.html is to where the css file is) would be /Css/index.css, and the same for your javascript files (/Scripts/index.js).

CSS file is not affecting my HTML or not loading without copying the FULL path

I am trying to link my CSS file to my html file and it is not linking without a Full path. They are on the same level, and I don't get the effect specified in the CSS file. The simple code in CSS is
body { background-color: blue; }
Thank you in advance for your help.
enter image description here
Correct me if I am wrong, but as far as I can see in the screenshot, the HTML and the CSS are not in the same folder. If you want to link to a CSS file that is in a higher directory you should use ../.
In your case, your code should be:
<link rel="stylesheet" type="text/css" href="../../css/styles.css">
Note: Please paste your code in your post instead of making a screenshot, it makes it harder for people to copy / edit things.
It seems you are not in the same directory as your css file. To achieve the desired reult, you will have to go up 2 directories and then access the file through the css folder.

Problem with html and css linking them together

I just started using html and css and I have to do something with it but I am getting the error Unable to open 'style.css'. I don't know what the problem is since the path that I used is the same as the file path.
Make sure the CSS file and the HTML file are in the same folder.
based on your image it should be
href="mywebs\site\style.css"
if you want to link site/style.css to mywebs/smth.html you should go one folder back.
<link href="../site/style.css">
or put the site folder inside mywebs, because based on the picture the site folder is not inside mywebs folder.
Sometimes the file may missed directory. You can close and open the code editor and it will work. Also, make sure your html and css file is in same directory. If you css file is in a different directory then use the following code:
<link type="text/css" href=".../style.css"/>

How to Link to a Stylesheet in a subfolder

I have an HTML file, index.html, for my website, in a folder. This folder contains the index.html file, and another folder called "Stylesheets", with the stylesheet.css file inside. How do I link to it? I know how to do a link tag, but the href bit is giving me a bit of trouble. I've tried
href="../stylesheets/stylesheet.css"
and a few variants of it with the dots. Any ideas? I've tried a couple google searches but the question is a bit too complex to describe in a simple google query. Please Help!
Your path - href="../stylesheets/stylesheet.css" is basically doing the opposite of what you want.It's not going one folder further as you wish.
To accomplish what you want, you are going to have this path:
href="stylesheets/stylesheet.css"
Here you can read more about File Paths.
Use href="stylesheets/stylesheet.css" or href="./stylesheets/stylesheet.css"
Both mean the look for stylesheet.css file inside the stylesheet folder inside the current folder.

I can't make the background-image work in Xcode in a UIWebview

From what I can tell, everything is correct... I have an html file called index.html, and a css file that has the background image reference.
It works if I just load the page on a computer, but no matter what I try to put in the css as the background image for index.html, I can't get it to show anything.
I even tried just putting css in the actual index.html file.
<style type="text/css">
body {
background-image: url('/images/warning_small.png');
background-repeat:repeat;
}
</style>
Is there something I don't know about UIWebviews? Does it not like certain images or something?
There is simple trick to follow, it will definitely work. Follow the simple steps..
Create a folder in your project folder system.
Put all the html and resources files in the folder.
Remove unlinked entries from project.
Then add the folder by check the option shown in the image below
The above step should create a blue folder uncommon than other folder.
The blue folder is the trick, when you will run the app in your app folder you will be able to see an extra folder which you added at step 4. Now since all you resource files are in the folder the html file will look for the resources in the folder itself, and it should work.
You might need to tweak the path in the html, but this should work. It works for me always.
Cheers.