<!DOCTYPE html>
<html><head><meta charset="UTF-8"><title>圣诞节快乐</title><style>/*设置背景色*/body{background-image:linear-gradient(green 50%,red 50%);background-size:100% 30px;}/*让div在页面居中*/#text{/*设置字体*/font: italic bold 100px "times new roman",sans-serif;/*设置字体为透明*/color:white; }#main{/*必须要开启绝对定位*/position:absolute;top:50%;left:50%;transform:translateX(-50%) translateY(-50%);}</style></head><body><div id="main"><div id="text">Merry Christmas</div></div></body>
</html>