Mobile app version of vmapp.org
Login or Join
Rambettina238

: CSS2 way of accomplishing what CSS3 border-image does? What is the best way these days to make a visually interesting border around a div using images? CSS3's border-image would perfect, but

@Rambettina238

Posted in: #Css #Images

What is the best way these days to make a visually interesting border around a div using images? CSS3's border-image would perfect, but it's CSS3. I don't want to rely on that yet. Is there a CSS2-compatible way to accomplish the same thing?

My audience is mostly with-it, tech-savvy, not needing hacks for decrepit old browsers, but aren't necessarily all up on the cutting edge like CSS3 either.

As an alternative to CSS for this, I tried some experiments with 3x3 tables using the images as cell background or cell content. The main content would go in the middle cell. I couldn't get the side images to stretch or repeat properly when the content varied.

10.02% popularity Vote Up Vote Down


Login to follow query

More posts by @Rambettina238

2 Comments

Sorted by latest first Latest Oldest Best

 

@Angie530

I think the least kludgy solution would involve nesting two divs, and applying the border and a padding to the outer div.

You may have to get creative with the application of the background, especially if it's anything more complicated than a tiling image, but it would avoid adding non-semantic tables to your markup. You should never use tables for layout.

10% popularity Vote Up Vote Down


 

@Miguel251

Couldn't you just have a div underneath your content div and just put the <img> tag in there?

10% popularity Vote Up Vote Down


Back to top | Use Dark Theme