How to create a radial gradient around navigation?

后端 未结 3 580
忘掉有多难
忘掉有多难 2021-01-22 01:12

\"enter

See the radial gradient flowing around the center of the navigation? Lets suppose

3条回答
  •  死守一世寂寞
    2021-01-22 01:49

    If you want to do this with CSS, you could use a radial gradient:

    background-image: -webkit-radial-gradient(contain, #bf8230 0%, #a65f00 100px);
    

    Example (jsFiddle).

    The above will create a circular glow with a radius of 100px centered in the padding-box of the

    .

    If you want to make a glow "around" an element, you could nest an element with a semitransparent gradient background inside one with a solid background, as in this example. You'd have to make sure that the nested element doesn't fill its container, and that its padding box can include the entire glow, or it will appear "cut off".

    (The example was only done for Chrome Beta, and will probably require appropriate vendor prefix incantations and testing for other browsers.)

提交回复
热议问题