Linking 2 different html pages to 2 different css files - html

I am creating a website using dreamweaver, and i faced a problem with linking a css file to an html page.
In this site, the index.html is linked to style.css and it's working properly, but when i link the page Products.html to styleproducts.css, the html page appears not linked to any style page.
I have placed style.css and styleproducts.css in a folder named "css" and i placed Products.html in a folder named "pages".
Here's the link code written in Product.html:
<link href="css/styleproducts.css" rel="stylesheet" type="text/css">
Any help would be appreciated!!

Your path is wrong try out this
<link href="../css/styleproducts.css" rel="stylesheet" type="text/css">
Your Product.html is in another folder. So you need to leave the folder with "../" than enter "css"

Related

How can I link CSS and HTML in different folders?

I have a stylesheet named style.css which is located inside a folder named css
And a HTML file named template.html in a folder named html
Both the folders are inside a folder named WebSite ( I guess that's the root folder. I'm new to html )
I want to link style.css to template.html using relative path.
My folder structure :
WebSite
|
|--css
|
|--style.css
|
|--html
|
|--template.html
|
|--index.html
I tried using
<link rel="stylesheet" href="../css/style.css" type="text/css" media="all" />
It didn't work
For more clarity I tried using view-source: before the url and clicked on the link but it showed
storage/emulated/0/WebSite/html/css/style.css (No such file or directory)
I am using Acode free app on Android mobile.
I have misread what you were actually asking for my fault. First I would test out linking the css sheet with a test html document to see if its something to do with the app. I dont know how "view source" works in this case but the view source is saying that your css folder, thus your css sheet is inside your html folder and according to your diagram explaining your folders, that is not true. In that case then your style sheet link would be <link rel="stylesheet" href="css/style.css" type="text/css" media="all"> An actual screenshot of your folder system , though not necessary, would be nice.

github.io and css linking

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>

How to link css file in asp.net project?

I have Index.cshtml file and I want to include login.css file there. Index.cshtml lives on Views/Home. I created login.css file in Views/Home/css folder. Here is how I linked it on Index.cshtml:
<link href="css/login.css" rel="stylesheet" type="text/css">
But it doesn't work. When I writes styles inside Index.cshtml, it works perfectly. Where I made a mistake?
Typically you would not put your css in the Views folder. This would belong at the root of the website project(wwwroot). This way you would reference your external styles like this:
<link href="~/css/login.css" rel="stylesheet" type="text/css">
You can juste drags you file css file into yous cshtml file and VS to the work for u

css link is not working. What can i do?

My css style link isnt working
I am a beginner and am trying to make a website.
I wrote the link in the header tag.
<link rel="stylesheet" type="text/css" href="styles/main.css"/>
First locate the folder where you saved your HTML file.
Create a folder named styles
In that styles folder, create your css file named main.css
Open that "main.css" file with notepad or notepad++(what you feel comfortable with), write your css code and save it.
That should work!

CSS Linking to HTML

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">