my links to my external .css fail in aptana but work on the live web server; how can i fix this? - css

my problem i think is simply to do with my .css paths.
for example my file structure is as so:
(root folder) mysite:
-index.htm
-styles.css
within my index.htm code, i link to my style sheets with the following code:
/styles.css
Now, changing the pathway is not a solution, i need to keep it as above with the "/" to point it to the root first. As the webstie works perfectly online this way.
Is there anyway i can get the site to display my styles locally, some kind of setting?
I have messed for hours reading through the forums here, and playing with setting the root.
i just dont get why once i set the correct root it messes up the path to the style sheets. I am starting to think it is impossible to link a .css file with "/" in Aptana.
any help would be appreciated.

If you remove the / from "/styles.css" then index.html will load it correctly both locally and on your website.
You also might want to look into the html base tag:
http://www.w3schools.com/tags/tag_base.asp
This would allow your pages to always point to the css file that is live on the website.
You say that "changing the pathway is not a solution", please explain? A live example would be good too.

Related

Icons not showing?

Icons not showing , So I've this problem.
I'm using some weather icons provided by erikflowers on github.
They are working and showing up fine when I've opened my app through the live server extension in Visual Studio Code. However, when I open my index.html manually from the folder, they are showing up as blank squares.
Anyone have any clue why this might be?
Thanks in advance
EDIT:
Directory:
<link rel="stylesheet" href="./weather-icons-wind.css">
<link rel="stylesheet" href="./weather-icons.css">
I did try changing to ./ no help
It says it can't find the files but they are there
Your pathing is wrong. As u wrote by urself in a comment -
"To use the Weather Icons, place the main CSS files in your CSS directory, and the font files in a "font" directory on the same folder level as the CSS director. Once you've done that, all you need to do to reference an icon in your HTML is type ""<i class="wi wi-night-sleet""> "
You dont have a CSS directory.
Also look at your console error.
The route is wrong.. your Project Name is missing.
"../JavaScript/Projects/fonts/weather..", where is your Folder "Weather API"?
I would suggest to create a CSS folder (your styles.css stays in the project root), with your icon stylesheet files in it. That should fix your problems.
How are you accessing those icons? CDN? Or do you have them stored locally in some separate folder? Also, share your index.html and folder structure.
For example, you have them in a folder called icons, say a file called cloud.png. Then there are 2 ways to access them in your HTML file:
Using icons/cloud.png
Using ./icons/cloud.png
Both of these approaches work in Live Server, but sometimes we have to use the 2nd one when opening index.html directly or when hosting on Github Pages.
So try both of them and see which one works for you.

CSS and img dont read on Github

I'm trying to upload one project on github but CSS and img wont read.
I have tried to upload it 2 times, and checked that files names is written with small letters and are the same in the name of the file and the same in the html code but it still wont work.
Site was build using bootstrap, it is first time for me using BS so i'm not sure if it is because of that.
I am attaching link to a site and link to my repositorie on github. are you able to see what problem is?
Link to a site:
https://veljko-premovic.github.io/Tindog/
Link to repositorie:
https://github.com/Veljko-Premovic/Tindog
thank you in advance
Veljko
You are serving your images from a folder called images, but there is not such a folder.
The same with CSS, you are serving your styles.css from a “css” folder that is non-existent in your Github repo.
Either create those folders and add the images and CSS in them, or in every “src=“, remove the folder name.
Your paths are wrong, they all point to images/something.png but the images are in the same root folder as index.html so it should just be
<src img="something.png">
same for the css

Cannot remove/replace/edit css file in Django

I think I'm having a ghost here or maybe I'm to newbie to figure out how to fix the issue. So, in my index.html I'm linking a css file which doesn't exist anymore and when I open the index page Django still renders it. Also, if I try too create it again and styling different it doesn't work nor to link another file, simple don't work, don't wanna recognize it. It's like the old file is saved somewhere and I cannot override it.
Do you have suggestions? I tried everything what came to my mind, even deleted and recreated the db.
Thanks!

CSS Root Path for Windows different with Mac?

I just started learning Compass by watching tutorial video. But my question is for general CSS.
Here's how the directory looks like:
/root
/images
/mySprites.png
/javascript
/stylesheets
/myStyle.css
index.html
When auto-generating sprites, Compass output the path like this:
url('/images/mySprites.png');
But using Chrome in Windows, that path leads to stylesheets/images/mysprites.png and thus not showing up.
He's using Chrome in Mac and the sprites are shown correctly.
I know / is used to start from root folder, but is it not working in Windows?
The / in the first is not one of the CSS rules if some browsers understand that you are pointing to the root folder, they are doing it on their own and there is no such thing in CSS. http://www.w3.org/TR/CSS21/syndata.html#uri
So, the best way is to enter paths relative to the CSS file, not the document root or enter full URL like this: http://example.com/images/mySprite.png
All the best wishes,
Mohammad Ali Sharpasand
As mentioned above, just use ".../images/mysprites.png" as that will instruct the CSS to look one level above it's containing folder.
I hope this answers your question!

CodeIgniter CSS files

I have a designer who makes the design for me and I want to start with CodeIgniter.
But the problem is to place the CSS and images file. I can put them in the root of the application but it is not supported in IDE (DW).
What I mean is the path is not working in DW to show CSS styling in live view and my designer can't make change without seeing styling.
I would also like to enable the intellisense feature on DW if possible.
Any help will be helful. Thanks.
You shouldn't rely on DW. The quickest thing you can do is to render him a HTML page which he can open and edit and DW, and then just copy the CSS changes to your CI project.
I always save CSS files in the root directory. That way, I can quickly access them using the shortest of paths inside CI's URL helper functions.
Such as...
echo site_url('css/style.css');

Resources