简体   繁体   English

将2个不同的HTML页面链接到2个不同的CSS文件

[英]Linking 2 different html pages to 2 different css files

I am creating a website using dreamweaver, and i faced a problem with linking a css file to an html page. 我正在使用Dreamweaver创建一个网站,但在将CSS文件链接到html页面时遇到了问题。

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. 在此站点中,index.html链接到style.css,并且工作正常,但是当我将Products.html页面链接到styleproducts.css时,html页面似乎未链接到任何样式页面。 I have placed style.css and styleproducts.css in a folder named "css" and i placed Products.html in a folder named "pages". 我将style.css和styleproducts.css放置在名为“ css”的文件夹中,并将Products.html放置在名为“ pages”的文件夹中。 Here's the link code written in Product.html: 这是用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. 您的Product.html在另一个文件夹中。 So you need to leave the folder with "../" than enter "css" 因此,您需要将文件夹保留为“ ../”,而不是输入“ css”

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM