i want to have the gradient as background image like this
how can i achieve that
EDIT: I want to stretch down to bottom , but if i repeat it then i see the top bar gain , i want that dark portion remain at bottom and central part expands
i want to have the gradient as background image like this
how can i achieve that
EDIT: I want to stretch down to bottom , but if i repeat it then i see the top bar gain , i want that dark portion remain at bottom and central part expands
If you really-really need to achieve this with background image, here is an example.
Of course it doesn't work everywhere — you need JS polyfill to make browser that don't support background-size
property happy. I would recommend jQuery Backstretch for this.
But, what you really want to do (I hope so, at least) is to make it as flexible as possible and thus, you should take a look at this or this CSS gradients tutorial instead of the image. And, of course, you can use one of the CSS gradients generator like:
I would do it using a div or other element at the top of the page to give you the 'bar' and use a gradient background image, attached to the body in your css, aligned to the bottom and repeated.
body{
background:url(yoururl.png) repeat-x bottom;
}
For the 'bar', use the following CSS for the same style effect...
.topbar{
position:relative;
top:0px;
left:0px;
height:30px; /* or whatever height you want */
}
Apply your colours and borders to the bar however you see fit.