I was trying to build a simple html page on github that can be used as a linking to some of my program there inside. I have build a index.html for my github.io page, so, I tried to display it but with no success. In fact the html code cannot find the css file. Any suggestions or experience in that?
Thanks
PS: the link is albz.github.io
or: https://github.com/albz/albz.github.io
several path options, local and absolute
In your _site directory the index.html is at the same level as main.css
Therefor, in the head section you should change:
<link rel="stylesheet" href="/_site/main.css"></head>
to:
<link rel="stylesheet" href="/main.css"></head>
Related
I uploaded index.html and CSS file in githuib pages.
like the images I uploaded.
But I don't know for what reason the CSS didn't load into index.html.
I guess it is because of the problem of the link addresse, but I don't how to fix it.
To make the CSS file to index.html file, how do i fix my codes?
enter image description here
you probably do have some problem with the linking of the css file.
normally css file should be linked between the head tag like this:
<head>
<link rel="stylesheet "href="filename.css">
</head>
to extend on this, if you have deployed your website on github pages, to see the effects there you need to push your changes to github first.
i want to add to Liemannen loop answer,
sometimes we need to add "./" on the css link like this if for some reason the css is not loaded
< link rel="stylesheet" href="./stylesheet.css">
I am doing some HTML & CSS tutorials, and I am unable to get my CSS to appear when I load my web pages.
I linked my CSS to the HTML skeleton.
Can you help me figure out the error?
Screenshot of my HTML document:
Screenshot of my CSS:
Both of the files are stored in the same folder:
If anyone could let me know where I went wrong so I could continue my process, I would appreciate it.
The index.html and the styles.css are in the same folder, so you shouldn't point to a sub-directory for the css. Try this:
<link rel="stylesheet" href="styles.css">
as both index.html and css files are in same folder, you can use
<link rel="stylesheet" href="styles.css?v=1.1.2">
here, v is version declared, so whenever you make changes in your css file, simply change this version numbers to get refresh css and changes to take effect in browser without cleaning caches..
you can also move your css file in stylesheets folder and can keep index.html structure as it is.... basically it is good practice to keep files in subfolders so we can find them easily when searching... for e.g. all .css files in stylesheet folder, all images in images or img folder, all javascripts in js folder...
by the way, what is m.m in css file, in body styling ??
I'm pretty much new to all of this and for the past days I've been working on my first Website using bootstrap. Locally, this works fine, but right now, when trying to get it up online, it looks like this:
http://wearemanjaro.de
Just ugly html, no css nor any images are loading.
I made the link above link to the html which is in the /manjarowebsitebootrap/robots/index.html path. The CSS (bootstrap and custom) is in the following directory: /manjarowebsitebootstrap/css/...
The link to CSS in my html looks like the following:
<link rel="stylesheet" type="text/css" href="../css/custom.css">
<link rel="stylesheet" type="text/css" href="../css/bootstrap.min.css">
Same problem with the images in my ../img folder. It all works fine locally. I'd really love some help or advice :)
First thing you need to do is use an absolute instead of a relative path.
if your directory structure is:
-root
--docs
---doc1.php
--includes
---header.php
---footer.php
---css.css
--index.php
In your header, you link to my CSS file like so:
<link href="includes/styling.css" type="text/css" rel="stylesheet" />
you need to do like this :
<link rel="stylesheet" type="text/css" href="/root/includes/css.css" />
You also need to use developer tools on chrome that will help you to debug these things.
I saw there that the images are not uploaded so once you able to upload them you will start getting them on the Website if the path is correct.
and best of luck for the new world of web development.:)
Your file structure has changed from local to online/live. I inspected your page, placed in the CDN for Bootstrap and pow, the styling came alive.
Use the following CDN to replace your current src='' path for bootstarp in your html head to see what I mean.
https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css
The next steps you should take: make note of where all your files are living on your server, you must place all associated files on the server, as specified by your code, i.e shows that you have a CSS folder.
Also is this HTML file located at the same level as the CSS folder or does this HTML file live in a folder of its own. If not your paths do not need to include the ../ portion and you should use just css/yourFileName.css
I have linked a CSS file to different HTML files around my site. The CSS file is stored in the root of my site. The file only works with the homepage, in the root folder (cPanelX file manager). The other pages will not display the main CSS. My HTML linking code follows. It is from the sub-pages, not in the site's root folder (even though the code is the same on the homepage HTML file). How do I get the sub-pages to display the main CSS?
<link href="homepagecss.css" rel="stylesheet" type="text/css">
I am really new to this, and any help would be appriciated.
Add a /
<link href="/homepagecss.css" rel="stylesheet" type="text/css">
There is my problem:
Since I had some organization issues with my website, I wanted to arrange my files to a better classification.
Now, the folder tree looks like:
www
ressources
images
...
css
design.css
mypage1
index.html
mypage2
index.html
index.html
And now I don't know how to link the css file to the pages stored in a folder like the "mypage1" folder.
To start from my C: drive will will produce path errors once online, I tried the "shortcuts to the css file in each folder" solution too, but I think there is a far better way to proceed.
Need some help!
Thanks again!
use the link:
<link type="text/css" rel="stylesheet" href="../ressources/css/design.css">
here, used ../ going back folder..
You can use:
<link rel="stylesheet" href="../ressources/css/design.css" type="text/css" media="all">
The .. will go one directory top. Since the html files are in a directory (like mypage1), this will go to the parent directory, which is www. Then the next that should be done is to pass the directory path to your CSS file, which in your case is /ressources/css/design.css.