background gradient with solid color

marcias

I have to do the following: The top of the div is an image of a gradient, then in the bottom it continues as a solid color. Can I do this with simple CSS? I know the following is invalid.

{background: url(img/right_column_bg_top.png) no-repeat rgba(10,26,39,1) top 225px;

Note: the first 225px, which the image fills, should be without the background-color

vals

As far as I know, you need to use a gradient for the solid color, so that you can set it correctly.

The CSS would be:

.imgbg {
   width:255px;
    height:355px;
   background:  url('http://blue2.hu/danone/nogravity/img/right_column_bg_top.png'), linear-gradient(90deg, #f7d8e8, #f7d8e8);
    background-position: 0px 0px, 0px 112px;
    background-repeat: no-repeat, no-repeat;
    background-size: 255px 112px, 255px 233px;
}

Here is your updated fiddle

Basic suport should be fine for browsers supporting multiple backgrounds, the only problem would be with IE <= 8. Gradient background could be a problem with IE9, but I think that it should work (I can not test IE9). If it would be really a problem, see colozilla for a fix.

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

From Dev

Start up with a solid background color

From Dev

TableViewCell Background Color Gradient

From Dev

Gradient background color on ::selection

From Dev

Apply gradient or solid color on dynamic element

From Dev

Heatmap.2 color gradient with an additional solid color

From Dev

Change element's background color with gradient to background color without gradient

From Dev

Gradient Stripe Background Color Understanding

From Dev

SVG shape transparency with solid color as a background

From Dev

FFMPEG waveform transparent, background solid color

From Dev

Change Windows 10 Background Solid Color in Python

From Dev

Only solid color possible as background in Windows 7

From Dev

how to make showcase solid background color

From Dev

How to fill in the rest of the background with a solid color

From Dev

CSS3 Liner Gradient solid color size

From Dev

Adding gradient to 3rd party solid color donut chart

From Dev

border background is getting solid color when applying to a background button

From Dev

Is it possible to combine a low opacity gradient and background color

From Dev

Setting background color instead of gradient for older browsers

From Dev

Making a gradient background continue the last color

From Dev

Changing background of UILabels in UIStackView to gradient color

From Dev

Setting background color instead of gradient for older browsers

From Dev

Changing background of UILabels in UIStackView to gradient color

From Dev

Android background that ripples when pressed, but solid color when selected?

From Dev

how to gradually turn the background opacity of a bootstrap navbar into a solid color

From Dev

How to set background to a solid color programmatically in Gnome 3?

From Dev

Android Wear - use specified solid color for notification background

From Dev

Changing a checked checkbox from a tick to a solid background color

From Dev

is there an easy way to set destop background to a solid color in Windows 8?

From Dev

How to set background to a solid color programmatically in Gnome 3?

Related Related

  1. 1

    Start up with a solid background color

  2. 2

    TableViewCell Background Color Gradient

  3. 3

    Gradient background color on ::selection

  4. 4

    Apply gradient or solid color on dynamic element

  5. 5

    Heatmap.2 color gradient with an additional solid color

  6. 6

    Change element's background color with gradient to background color without gradient

  7. 7

    Gradient Stripe Background Color Understanding

  8. 8

    SVG shape transparency with solid color as a background

  9. 9

    FFMPEG waveform transparent, background solid color

  10. 10

    Change Windows 10 Background Solid Color in Python

  11. 11

    Only solid color possible as background in Windows 7

  12. 12

    how to make showcase solid background color

  13. 13

    How to fill in the rest of the background with a solid color

  14. 14

    CSS3 Liner Gradient solid color size

  15. 15

    Adding gradient to 3rd party solid color donut chart

  16. 16

    border background is getting solid color when applying to a background button

  17. 17

    Is it possible to combine a low opacity gradient and background color

  18. 18

    Setting background color instead of gradient for older browsers

  19. 19

    Making a gradient background continue the last color

  20. 20

    Changing background of UILabels in UIStackView to gradient color

  21. 21

    Setting background color instead of gradient for older browsers

  22. 22

    Changing background of UILabels in UIStackView to gradient color

  23. 23

    Android background that ripples when pressed, but solid color when selected?

  24. 24

    how to gradually turn the background opacity of a bootstrap navbar into a solid color

  25. 25

    How to set background to a solid color programmatically in Gnome 3?

  26. 26

    Android Wear - use specified solid color for notification background

  27. 27

    Changing a checked checkbox from a tick to a solid background color

  28. 28

    is there an easy way to set destop background to a solid color in Windows 8?

  29. 29

    How to set background to a solid color programmatically in Gnome 3?

HotTag

Archive