html - 背景透明的顶部

标签 html css wordpress background

首先,这是针对 wordpress 主题的盒装部分。 我想要做的是使背景的顶部透明 300px,其余为#f2f2f2。 检查这个例子: 背景:线性渐变(到顶部,#9c9e9f 0%,#9c9e9f 50%,#33ccff 50%,#33ccff 100%); 我想要以像素为单位而不是百分比

最佳答案

经过一些研究和编辑,我能够得到颜色的急剧变化。

这里是答案:

background: -webkit-linear-gradient(top,  transparent 0px,transparent 300px,#f2f2f2 300px,#f2f2f2 100%);
background: -o-linear-gradient(top,  transparent 0px,transparent 300px,#f2f2f2 300px,#f2f2f2 100%);
background: -moz-linear-gradient(top,  transparent 0px,transparent 300px,#f2f2f2 300px,#f2f2f2 100%);
background: linear-gradient(top,  transparent 0px,transparent 300px,#f2f2f2 300px,#f2f2f2 100%);

关于html - 背景透明的顶部,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/30594497/

相关文章:

html - 如何让复选框+标签系列在填充可用宽度的同时垂直堆叠?

html - 在 Safari 和 Chrome 中格式化

html - CSS3 交替表行不透明度影响文本和背景

移动导航栏的 jQuery 错误

php - 从 href 链接问题下载 pdf

wordpress - 递归加载其他组件的 React 组件

html - 使用子链接时保持父链接悬停

css - 在没有 Bootstrap 的情况下推拉 css

css - 位置 :relative for anchors in webkit broken. 解决方法?

css - 使媒体导航栏在 Wordpress 网站上发挥作用