我们如何管理多个关于css的html页面呢?
我完全是初学者,我想知道文件夹中的页面管理。我正在创建一个具有 5 个不同页面的网站,这些页面都位于同一个文件夹中。顺便说一下,我的 css 使用的是 sass。
目前,我只有 1 个 css 文件,该文件最初是为我的第一页设计的。但现在我正在做另外 4 个,我想知道是否可以:
- 创建与我拥有的 html 页面一样多的 css 文件?就我而言,我有 5 个 html 页面和 5 个 css。
- 我不知道如何管理我的 sass:我应该创建 5 个不同的 package.json 文件吗?或者我可以创建 5 个不同的 scss 文件,它们将被编译为 5 个不同的 css 文件?在这种情况下,我是否应该在 package.json 文件中创建 5 个不同的脚本来为每个 scss 文件指示正确的 css 文件?
抱歉,如果我的问题以及我的英语不清楚。非常感谢你们。
I'm totally beginner, and I was wondering about page management in my folder. I'm creating a website that has 5 different pages, that are all located in the same folder. By the way I'm using sass for my css.
At the moment, I only have 1 css file, that was designed originaly for my first page. But now that I'm doing the 4 others, I'm wondering if :
- is it ok to create as many css file as I have html pages ? In my case I'd have 5 html page and 5 css.
- I don't know how to manage my sass : should I create 5 different package.json files ? Or I can create 5 different scss files, that would be compiled in 5 different css files ? In this case should I create 5 different scripts in my package.json file that would indicate for each scss file the right css file ?
Sorry if my questions are not clear , as well as my english. Thank you so much guys.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
我不是 sass 专家,但我可以为您提供 HTML 文件的 CSS 文件管理。顺便说一句,每个人都会有自己的建议。创建一个通用 CSS 文件。在此文件中,您将为所有页面添加默认主题。然后将其与所有 HTML 文件连接,最后对于每个页面的单独 CSS,在 HTML 页面的样式标签中进行操作。
I am no expert in sass but I can give you the CSS file management for your HTML file. By the way everyone will have their own suggestion. Create a common CSS file. In this file you will add your default theme for all pages. Then connect it with all the HTML files, And finally for individual CSS for each page, do it in the style tags in your HTML pages.
我对 sass 也不太了解,但对于 CSS,我建议为所有 HTML 文件创建一个 CSS 文件。然后,您可以为所有页面创建基本样式(所有页面的样式都相同)。对于单独的 CSS(每页更改的 CSS),您可以:
我认为使用类更容易,特别是如果您的所有页面都有通用样式,但这取决于你。希望这有帮助!
I don't know a lot about sass either, but for CSS, I would recommend creating one CSS file for all of your HTML files. Then, you can create a base style for all of your pages (styling that's the same for all pages). For individual CSS (CSS that changes per page), you could:
I think using classes is easier, especially if you have a common style for all of your pages, but it's up to you. Hopefully that helped!