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 - Bootstrap 4 中的 Flexbox 表现得很奇怪

css - 包含其他 div 的 div 没有适当的高度

css - 输入类型文本不在同一位置?

html - 当我有多行并且想要左列右对齐和右列左对齐时,如何解决没有表格的表格对齐问题

android - 为 wordpress 网站推送通知?

php - Wordpress 网站在除本地服务器之外的设备上呈现不同

php - WP HTML 缩小类不起作用

html - CSS3 3D 立方体无法在 Internet Explorer 中正确显示

javascript - 如何替换 html textarea 中当前选定的文本?

css - Internet Explorer 中::before 伪元素的位置和大小