Click to See Complete Forum and Search --> : Is possible to add border-top also image?


toplisek
11-28-2008, 05:17 AM
Is possible to add border-top also image or there is no chance to replace normal:border-top : 1px solid #cccccc;

Will work image in all browsers?

sticks464
11-28-2008, 11:17 PM
Put your image in a container and give it top padding. Set the background of the container with the image you want as a border.
html
<div class="box">
<img src="myimage.jpg" alt="my image">
</div>

css
div {
width:150px; /*same as image width */
height:150px;/* same as image height */
background:red ; /*replace color with url(pathtoimage.jpg); */
}
div img {
width:150px;
height:150px;
padding-top:10px; /* increase/decrease for top border */
}

Tabo
11-29-2008, 04:30 AM
If you mean you want a border image, this is part of the CSS 3 specification and therefore can't be used yet.

However I do think that webkit and gecko have or have done in a nightly build added support for this using the prefix -webkit- and -moz-

http://www.css3.info/preview/border-image/