普通的編程語言有這樣的東西CSS是否有創建更緊湊代碼的子面板的方法?
int x, y, z;
,這樣你就不必寫出
int x;
int y;
int z;
在CSS中我經常發現自己不必寫這樣的東西
.some-class h1, .some-class h3, .some-class p { margin-bottom: 1.2em; }
當它看起來應該像
.some-class (h1, h3, p) { margin-bottom: 1.2em; }
有沒有這樣的事情?
您將需要一個CSS預處理器,如[LESS](https://en.wikipedia.org/wiki/Less_(stylesheet_language)#Nesting)做類似的事情。 – jfriend00
或者你可以這樣做:.some-class h1,h3,p {margin-bottom:1.2em; } –
@ZiggyVerstrepen這有效嗎? –