Home > Enterprise >  How do we manage multiple html pages about css?
How do we manage multiple html pages about css?

Time:02-26

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.

CodePudding user response:

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.

CodePudding user response:

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:

  • Use classes
  • Put your individual styling in the style tag in the head of your html page

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!

  • Related