将.css链接到另一个文件夹 [英] Link a .css on another folder

查看:112
本文介绍了将.css链接到另一个文件夹的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一些关于如何链接内容的问题。



想象一下,我有一个文件夹网站,其中存储了该网站的文件,字体,并且字体文件夹为每个字体有更多的文件夹。我的html和css文件是直接在网站文件夹。我的font-face-css文件在/ font文件夹中。



我想将css文件链接到我的html文件,所以我这样做:href =stylesheet .css



我还想将我的font-face-css文件链接到我的html文件,那么我应该放在href =?

我还想链接我的字体,这是在自己的文件夹,这也是在字体文件夹中的css文件是我的font-face-css文件,我应该放在src里面:?

  1网站文件夹
1.1字体文件夹b 1.1.1 Font1文件夹(/ fonts / font1)
1.1.1.1 ttf文件(/font/font1/font1.ttf)
1.1.1.2 svg文件(/font/font1/font1.svg)
1.1.2 Font2文件夹(/ fonts / font2)
1.1.2.1 ttf文件(/font/font1/font2.ttf)
1.1.2.2 svg文件(/ font / font1 / font2 .svg)
1.2 html文件(file.html)
1.3 css文件(file.css)


b $ b

谢谢

解决方案

我不清楚,你想链接外部css作为结构的上面定义的文件?如果是,那么只需使用链接标签:

 < link rel =stylesheettype =text / csshref = file.css> 

所以基本上对于你的网站文件夹下的文件夹(包含你的索引的文件夹),你直接调用它。对于每个连续的文件夹,在您的情况下使用/例如:

 < link rel =stylesheettype = text / csshref =Fonts / Font1 / file name> 
< link rel =stylesheettype =text / csshref =Fonts / Font2 / file name>


I have some questions about how to link things.

Imagine that I have a folder "Website" where my files for that website are stored, and another folder with fonts, and that the font folder has more folders for each font. My html and css file is directly on the website folder. My font-face-css file is on the /font folder.

I want to link my css file to my html file, so I do this: href="stylesheet.css"

I also want to link my font-face-css file to my html file, so what should I put inside href=""?

And I also want to link my fonts, which are in their own folder, which is also inside the font folder which is where the css file is to my font-face-css file, what should I put inside the src:?

 1 Website folder
    1.1 Fonts folder (/fonts)
       1.1.1 Font1 folder (/fonts/font1)
             1.1.1.1 ttf file (/font/font1/font1.ttf)
             1.1.1.2 svg file (/font/font1/font1.svg)
       1.1.2 Font2 folder (/fonts/font2)
             1.1.2.1 ttf file (/font/font1/font2.ttf)
             1.1.2.2 svg file (/font/font1/font2.svg)
    1.2 html file (file.html)
    1.3 css file  (file.css)

Thank you

解决方案

I dont get it clearly, do you want to link an external css as the structure of files you defined above? If yes then just use the link tag :

    <link rel="stylesheet" type="text/css" href="file.css">

so basically for files that are under your website folder (folder containing your index) you directly call it. For each successive folder use the "/" for example in your case :

    <link rel="stylesheet" type="text/css" href="Fonts/Font1/file name">
    <link rel="stylesheet" type="text/css" href="Fonts/Font2/file name">

这篇关于将.css链接到另一个文件夹的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆