最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

如何使用CSS创建对角线背景效果

SEO心得admin37浏览0评论
本文介绍了如何使用CSS创建对角线背景效果的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

是否可以使用CSS创建如下图所示的效果?

/ b>

基本上我想创建一个背景分割为对角的< div> s你可以使用线性渐变 $ c>在背景上。请参阅以下示例:

body {height:100vh;宽度:100vw;背景:线性渐变(160deg,红色,红色60%,白色60%,白色);}

$ b

Is it possible to create the effect shown in the following image, using CSS?

Basically I want to create <div>s that have a background split diagonally with a block color on side and white on the other?

解决方案

You can use linear-gradient on background. See the following example:

body { height:100vh; width:100vw; background:linear-gradient(160deg, red, red 60%, white 60%, white); }

发布评论

评论列表(0)

  1. 暂无评论