如何使用html制作一个简洁的提交表单(代码详解)

  之前的文章《如何使用html制作一个简洁的提交表单(代码详解)》中,给大家介绍了怎样使用html制作一个表单。下面本篇文章给大家介绍怎样使用css设置背景色渐变呢,我们一起看看怎么做。

  css渐变背景色_css repeat-x 渐变图片_css半透明渐变

  它们都可以用自己的方式表示任何颜色css渐变背景色,只不过角度不同。

  在RGB模式下,所有颜色都可以用红(red)绿(green)蓝(blue)的不同能比组合得到。

  如:

  rgb(100%,0%,0%)为红色;

  rgb(100%,50%,0%)为橘红色;

  rgb(80%,0%,100%)为紫色。

  可以在浏览器内分别测试这几个值

  <pre class="brush:php;toolbar:false">root { background rgb(100% 0% 0%); }</pre>

  CSS设置div渐变背景的方法

  1、使用一个div标签。

  <pre class="brush:php;toolbar:false">


     
    css颜色渐变 


    
        
    

e>

  2、header标签里面设置

  标签。

  <pre class="brush:php;toolbar:false">


     
    css颜色渐变 
    
        div{
            
        }
    


    
        
    

e>

  3、颜色渐变css渐变背景色,需要给div设定width和height,宽度和高度。

  <pre class="brush:php;toolbar:false">


     
    css颜色渐变 
    
        div{
            width:150px;
            height:70ps;
        }
    


    
        
    

e>

  4、然后设置div的background背景属性,背景颜色渐变就用到-webkit-linear-gradient。

  <pre class="brush:php;toolbar:false">


     
    css颜色渐变 
    
        div{
            width:150px;
            height:70ps;
            background:-webkit-linear-gradient();
        }
    


    
        
    

e>

  5、在-webkit-linear-gradient里面写top,设定渐变从顶部开始,到底部结束。写了top就不要写bottom。

  <pre class="brush:php;toolbar:false">


     
    css颜色渐变 
    
        div{
            width:150px;
            height:70ps;
            background:-webkit-linear-gradient(top);
        }
    


    
        
    

e>

  6、再设定颜色的渐变顺序,颜色可以设定多。

  <pre class="brush:php;toolbar:false">


     
    css颜色渐变 
    
        div{
            width:150px;
            height:70ps;
            background:-webkit-linear-gradient(top,white,lightblue,skyblue);
        }
    


    
        
    

e>

  效果图如下:

  1.jpg

  推荐学习:CSS视频教程

  以上就是CSS篇:如何将页面背景设置渐变效果(代码详解)的详细内容,更多请关注php中文网其它相关文章!

文章由官网发布,如若转载,请注明出处:https://www.veimoz.com/1917
0 评论
447

发表评论

!