Is it possible to create a linear-gradient background that starts from the center or middle of the screen?
This is the CSS I am currently using:
body {
display: table;
width: 100%;
height: 100%;
margin: 0 auto;
background-repeat: no-repeat;
background-attachment: fixed;
background-position: center top;
background-size: 800px;
background: blue;
background: -webkit-linear-gradient(to left, black, blue, blue, black 800px);
background: linear-gradient(to left, black, blue, blue, black 800px);
}
The gradient background stops after 800px as desired, but it is on the right side of the screen rather than behind the content of the webpage. I cannot move it elsewhere and its position varies with window size. I need it to stay fixed in the center behind my content.
Is there something like the following line available?
background: linear-gradient(to sides, blue, black 400px);
I want to be able to set the starting position of the linear-gradient to the center and have it run to both sides. It should stop at 400px from the center (using the last color thereafter) making it a total width of 800px for the gradient.