当前位置: 代码迷 >> 综合 >> css的linear-gradient
  详细解决方案

css的linear-gradient

热度:11   发布时间:2023-11-25 17:44:42.0
<!DOCTYPE html> <html> <head><title></title><style type="text/css">*{
    margin: 0;padding: 0;}div{
    width: 300px;height: 200px;border: 1px solid #000;box-sizing: border-box;margin: 200px auto;/*默认情况下会从上至下的渐变*//* background: linear-gradient(red,green);*//*background: linear-gradient(to top,red,green);*//* background:linear-gradient(to top right,red,green);*/background: linear-gradient(45deg,red, green);}</style>
</head>
<body>
<div></div>
</body>
</html>
  相关解决方案