Declaring same CSS class multiple time

前端 未结 5 965
独厮守ぢ
独厮守ぢ 2021-01-07 05:39
haha
haha

This (type 1) seems workable :-

.big_         


        
5条回答
  •  不要未来只要你来
    2021-01-07 06:38

    There is no issue using the first syntax.

    It is actually useful, as you noticed to avoid repeating the same time the same styling.

    It is also useful to separate the types of styling: positionning, fonts, colors.

    You can for instance have in one file the styling that positions the elements and in another file the styling for the colors/backgrounds, allowing you to change the "theme" of your site by just changing the css file responsible for your colors, without breaking the layout itself.

    This is for instance what is used in jQuery UI CSS Framework. You have:

    • the jquery ui base css
    • all the jquery themes files

提交回复
热议问题