• First Link
    All geek questions in one place

    How to add vertical gradient using css?

    I have a vertical submenu:

    <div id="dropdown_menu" class="menu">
    <ul>
    <li> <a>First Link</a></li>
    <li> <a>Second Link</a></li>
    </ul>
    </div>
    

    I put the bottom of the background in the css menu "menu"., The top cut of the background in .menu ul. Now I have one vertical gradient that changes color from top to bottom (in the whole vertical menu), and therefore I can not put it in .menu ul li. Is it possible to add a vertical gradient without making any changes to the html?

    +3
    html css gradient
    svirk Oct 08 '10 at 18:56
    source share
    2 answers
    #dropdown_menu {
        filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#FF280C00', endColorstr='#004A1D00'); /* for IE */
        background: -webkit-gradient(linear, left top, left bottom, from(#280C00), to(rgba(75, 30, 0, 0))); /* for webkit browsers */
        background: -moz-linear-gradient(top,  #280C00,  rgba(75, 30, 0, 0)); /* for firefox 3.6+ */
    }
    

    See the actual implementation here: http://www.salonbelledesoir.com (Gradients around the edge are CSS gradients.)

    Opera ( -o-gradient, .

    , , .

    +7
    Ryan Kinal 08 . '10 19:04

    , x- . -, . :

    .gradient {
      background: #xxx url(pathtoimagedirfromcssfile/background.jpg) center top repeat-x;
    }
    

    #xxx - , - .

    +4
    Lucius 08 . '10 19:50

    Source: https://habr.com/ru/post/1768679/

    More articles:

    • How do I create a daemon in uClinux using vfork? - c
    • Streaming video for Windows Media Player via http - java
    • Keyboard information inside "didRotateFromInterfaceOrientation" - iphone
    • PHP web application and bulk mailing - php
    • Read a few lines from subprocess .Popen.stdout - python
    • _events is a null or not object error only when compiling debug = "false" - asp.net
    • Restarting regular threads - multithreading
    • Return to SurfaceView after another - android
    • What is the real cost of an SQL transaction? - sql
    • How to create static ARP cache entries programmatically in Windows XP - c #

    All Articles

    Geek Questions | 2019