html - 如何在两侧实现多种颜色和对 Angular 线形式的背景?

标签 html css

我的目标设计

enter image description here

我有这个设计 -- jsfiddle --

我在边框前后都用了这个方法。

::before SPORTS ::after

用于::after css

display: block;
-webkit-box-sizing: border-box;
-moz-box-sizing: border-box;
box-sizing: border-box;
content: '';
border-color: inherit;
border-top: 0 solid rgba(255, 255, 255, 0);
border-bottom: 35px solid rgba(255, 255, 255, 0);
border-left: 10px solid #f54545;
-ms-box-sizing: border-box;
text-rendering: optimizeLegibility;

并且我为 ::after 尝试了所有可能的 css,例如 -webkit-border-image、background css 等

如何实现目标设计。

最佳答案

我的解决方案来自 danko 的 jsfiddle 下面的 css 对我很有帮助

background: linear-gradient(to right, #ff3333 0%, #ff3333 85%,#3399cc 85%,#3399cc 90%,#ffff66 90%, #ffff66 95%, #ff0099 95%, #ff0099 100%);
width:100%;
height:100%;
-webkit-transform:skewX(-25deg);
-webkit-backface-visibility: hidden;

关于html - 如何在两侧实现多种颜色和对 Angular 线形式的背景?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/26588098/

相关文章:

html - Internet Explorer 10 菜单项意外显示焦点轮廓

php - 需要通过 css 将颜色添加到 html 表格

javascript - Polymer,如何使用应用程序定位?

javascript - 如何在内部图像使用宽度 : 100% 的 div 上使用 height()

java - HTML : Mozila firefox issue 中选择字段的文本(选项)的颜色不同

php - 图片上的链接在移动设备上不起作用

HTML 页脚问题

HTML 电子邮件 : tables or divs?

html - 无法将 Div 居中

html - 我无法让 Logo 在标题中垂直居中