So, let's say that we have a large project with a large number of pages, and we need to add one html page to it.
After creating the page, I saw that some of the id and classes that I use are displayed on other pages as well. So providing css styles for this id poses huge problems for me. So, what is the best way to give id and classes, so that the probability of doubling in the project will be the least?
One way is to add the page name to the attribute. So instead
id="button"
will have
id="mypage-button"
But in this way id and classes become more and less readable. Another approach is to give the full path to this component in CSS and minimize the likelihood of doubling identifiers. For example, instead of providing in CSS
#myTable { height:300px; }
Now i will give
#myBigDiv > #AnotherDiv .tables #myTable { height:300px; }
But this path is slower, and I will quickly lose speed. Placing my own css file on my page does not solve the problem, because the presence of some written property that I do not know has some other property (for example, margin) specified in the css files that are indicated in the layout. What do you think is the best way to do this?
source share