How to manage large CSS/HTML/Javascript codes?

So I was making a simple nav bar using HTML/CSS/Javascript, and the whole script took up a lot of space (especially the CSS part). I had to scroll a lot to find what I was looking for in the codes, and that was just for a little navigation bar. So I was wondering how do you guys manage CSS codes for larger websites? Any advice appreciated.

I can relate to what you are saying. I want to know the answer how it can be managed in huge websites too. But what I do for my coding is I always mention comments on every division of the HTML/CSS/Javascript so that easy for me to come back and have a look if there is a bug or if i need any changes.

2 Likes

Often we use something like webpack, that allows us to split these into different files for development and then we can build them into bundles for deployment to the frontend. Also, there are backend templating libraries that will allow you to split things into separate files that get rendered on the server side.

3 Likes

Right now you should survive with that, then when you get into other libraries and much more like using React or Vue, you will start to see how code splits. But you can use something like Parcel.js or Webpack.

2 Likes