views:

218

answers:

3

like this

alt text

in my design both side of div has border like this and content in div can be increased or decreased . and in any condition both side top and bottom should be blur like this.

How to make this possible? using css, image any method...

+1  A: 

Here is an example of the CSS3 (Webkit and Moz) gradient codes in effect at the moment. I don't think what you're asking is doable without images. Maybe you could use SVG?

-webkit-gradient(
    linear,
    left bottom,
    left top,
    color-stop(0.17, rgb(10,74,133)),
    color-stop(0.78, rgb(146,189,224))
)
-moz-linear-gradient(
    center bottom,
    rgb(10,74,133) 17%,
    rgb(146,189,224) 78%
)
Kyle Sevenoaks
ok how to do with image.?
metal-gear-solid
@metal: Here's the plan. Three images, two of fixed size stuck to either end that do the gradient ends, and one that stretches for the space between (and which doesn't vary in color in the direction that is stretched). I can't be bothered to work this into a proper answer as CSS is not my thing.
Donal Fellows
@Donal - i want to do with one image or css.
metal-gear-solid
@Kyle Sevenoaks - i want to blur from top and bottom.
metal-gear-solid
A: 

For Safari/Chrome and Firefox you can use the CSS3 border-image: http://www.css3.info/preview/border-image/

NathanLoehlein
A: 

this is your top part of your div with fixed height:

-webkit-gradient(
    linear,
    left top,
    left bottom,
    color-stop(0.08, rgb(240,240,240)),
    color-stop(0.96, rgb(130,130,130))
)
-moz-linear-gradient(
    center top,
    rgb(240,240,240) 8%,
    rgb(130,130,130) 96%
)

this is your bottom part with fixed height

-webkit-gradient(
    linear,
    left bottom,
    left top,
    color-stop(0.08, rgb(240,240,240)),
    color-stop(0.96, rgb(130,130,130))
)
-moz-linear-gradient(
    center bottom,
    rgb(240,240,240) 8%,
    rgb(130,130,130) 96%
)

between these two elements is your variable height div. to customize colors and gradients, use one of thousands of tools like http://gradients.glrzad.com/

koko
I need this `border` for `border-right` of a `div`. `<div id="box1"> some text </div>`
metal-gear-solid
well, then you would have to put this stuff in a right positioned div, but then you could use an image as well. i don't think it is possible in a more elegant way.
koko