Harish Choudhary Harish Choudhary - 5 months ago 8
CSS Question

Body of a background in Html

In my rails application, I want to change the pattern of my , similar to the one shown in picture:

enter image description here

I want to know, is there any other option other than using image in html/css, to generate background of a website like the one shown in image.

Thanks

Answer

This css snippet will generate the required background.

body {
    background:
        -moz-radial-gradient(#000 10%, transparent 16%),
        -moz-radial-gradient(#000 10%, transparent 16%),
        transparent;
    background:
        -webkit-radial-gradient(#000 10%, transparent 16%),
        -webkit-radial-gradient(#000 10%, transparent 16%),
        transparent;

    -webkit-background-size:7px 7px;
    -moz-background-size:7px 7px;
    background-size:7px 7px;
}

The fiddle for the same.

Comments