我使用以下代码将背景设置为蓝色:
<!DOCTYPE html>
<html>
<body style="background-color:blue;">
</body>
</html>
这个方案很不错,但是如何让背景有两种不同的颜色呢?例如,将50%的背景设置为蓝色,其余50%设置为黄色,水平分割...
我使用以下代码将背景设置为蓝色:
<!DOCTYPE html>
<html>
<body style="background-color:blue;">
</body>
</html>
这个方案很不错,但是如何让背景有两种不同的颜色呢?例如,将50%的背景设置为蓝色,其余50%设置为黄色,水平分割...
background: linear-gradient(blue, yellow);
如果您不想要渐变淡出效果,可以设置位置:
background: linear-gradient(to right, blue 0%, blue 50%, yellow 50%, yellow 100%);