2
有幾個邊框圖像屬性,比如border-image-source,border-image-slice,border-image-width,border-image-repeat,border-image-outset,我在一本書中讀過說,你不應該使用的屬性分別,如:border-image- *屬性可以在CSS3中單獨使用嗎?
.border-image-class {
border-image-source: url("image.jpg");
border-image-slice: 10 20 10 20;
border-image-releat: repeat;
}
你我應該寫這樣的:
.border-image-class {
border-image: url("image.jpg") 10 20 10 20 repeat
}
但W3Schools的給予使用的一些例子單獨的屬性: http://www.w3schools.com/cssref/css3_pr_border-image.asp
哪一個是對的?
兩種解決方案都是正確的。這取決於編碼器的風格。組合這些值可能會節省一些空間,並且可能會讓某些人感到愉快,而分離的屬性則可確保可讀性。我更喜歡使用SASS中的分隔屬性(除邊距,填充和邊框外)。 – 2014-08-29 03:47:21