简体   繁体   English

如何使引导程序Navbar背景透明地淡入网页

[英]How to make bootstrap Navbar background have a transparent fade into the webpage

I'm using JS BootStrap for making my NavBar and I was wondering if there was any styling techniques to have my fixed NavBar at the top of my website have a background of color that evenly fades from cyan towards the top of the NavBar to almost white at the bottom of the NavBar, so that it nicely flows into the whitish gray in the rest of my webpage. 我正在使用JS BootStrap制作NavBar,我想知道是否有任何样式设置技术使我的网站顶部固定的NavBar的背景颜色从青色朝NavBar顶部均匀褪色到几乎白色在NavBar的底部,这样它就很好地流入了我网页其余部分的淡灰色。

Thanks for any help or advice. 感谢您的帮助或建议。

Try this: 尝试这个:

.navbar {
    background: linear-gradient(to bottom, cyan 0%, rgba(0,0,0,0) 100%);
}

NOTE : You will need to remove the border and background color on the navbar. 注意 :您需要删除导航栏上的边框和背景色。 Also, you'll need to add all the cross-browser support for that gradient. 另外,您需要为该渐变添加所有跨浏览器的支持。 Here's a useful gradient generator: http://www.colorzilla.com/gradient-editor/ 这是一个有用的渐变生成器: http : //www.colorzilla.com/gradient-editor/

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM