Setting linear gradient height AND width
问题 I am aware that you can set the width of a linear gradient using .grey-block { background: linear-gradient(to right, #f9f9f9 0%, #f9f9f9 35%, white 35%, white 100%); } As well as the height .grey-block { background: linear-gradient(to bottom, #f9f9f9 0%, #f9f9f9 65%, white 65%, white 100%); } However, is there a way you can set BOTH the height and the width using a the same css line? 回答1: To clarify, the code in the question is not setting the height and width of the gradient. It's adjusting