Forum Moderators: not2easy
Is it possible to have borders around a <div> or <span> that are images? I don't mean something like this:
img {
border: 1px solid #000;
}
I'm talking about using an image as the actual border, via CSS or any other means. I know it could be done by setting a background, but I need something that can scale on the X and Y-Axis.
I'd appreciate any help.
<div id="content">
<div id="content_top"></div>
<div id="content_main"></div>
<div id="content_bottom"></div>
</div>
Then CSS:
#content_top{
background-image:url(img src);
background-repeat: whatever you need here;
height: height of the bgimage;
}
#content_main{
background-image:url(img src);
background-repeat: repeat-y;
}
#content_bottom{
background-image:url(img src);
background-repeat: whatever you need here;
height: height of the bgimage;
}
Now you have to cut up your image perfectly in photoshop so that everything lines up right. For the main content image, since that will most likey be something that needs to expand as content changes, make the image 1px in height, it looks smoother on the repeat.
Hope this helps!
For the rest, well ... Graceful degradation seems to be the way to go if you wan tto avoid adding a lot of html
[w3.org...]
If you want a special corners on images though for instance, we're talking getting an effect called "rounded corners" or "custom borders". Usually it involves nesting about 3-4 divs to get a pretty good cross-browser supported variable size box.