• There is an important update regarding account security and 2FA. Please click here for more information.
  • Welcome to PokéCommunity! Register now and join one of the best fan communities on the 'net to talk Pokémon and more! We are not affiliated with The Pokémon Company or Nintendo.
  • Imgur has blocked certain regions from viewing any images uploaded to their site. If you use Imgur, please consider replacing any image links/embeds you may have on PokéCommunity so everyone can see your images. Click here to learn more.

composing the perfect CSS rounded box

Master Kwesi Nkromah

"Pokéfan Kwesi"
  • 992
    Posts
    21
    Years
    We all love 'em but how do "you" create them? How do you make your rounded box? Do you use images, standard css, or browser specific hacks?

    The last time I used rounded squares i ended up using the browser specific css attribute -moz-border-radius. I admit, it was a lazy move and it only worked for about half of my visitors... but hey... it kinda worked...

    I'm working on something now and I've decided to go with images.
     
    I create 2 images, one for the round parts at the top and one for the bottom, then I create two boxes, and I place each on in the background. Top one for the top and visa versa. If the box is also suppose to have shadow effects on the outside then it's just a matter of creating a third image with the correct width, and shadow on the sides, then add a third box behind the two and add the third image. Pretty simple. Good luck.
     
    Yea, I doing pretty much the same thing you are, two images for the top and bottom. However, I don't make them the background of the division. I place the top curve inline with the rest of the page's content and the bottom curve at the end of the inline content. I just place padding around the content so everything looks more natural.

    i still think it's a lazy approach. CSS3 supports rounded boxes right?
     
    I'm all for cross-browser support, so I use images.
     
    our sites that use a rounded box, typically are using the 2+ image method as current browsers still have issues with 100% pure css ones.

    as more browser become more css3+ compliant that may change.
     
    Back
    Top