May
01
2008
|
| ||||||
| HariesDesign.com - There are other ways that I’ve seen it done, but the other methods always require lots of complex HTML and CSS. I figure that lots of nested divs aren’t much better than using a table, so my way doesn’t require much in the way of HTML or CSS. Here’s how I do it. Create four images for your corners. ex: Adobe Photoshop
…and I’m going to cut off the corners to get my four images: In the spot where I want the box to show up, I create a container div to hold the box, a div for the top row and a div for the bottom row. Between the top and bottom rows, I add my content. In the top and bottom row divs, I add the left corner image and set the inline style to read display: none; . This makes the image invisible unless I make it visible through the stylesheet. That way, I can hide the effect from incompatible browsers by not showing them the stylesheet.
<div class="roundcont"> HariesDesign.com HariesDesign.com HariesDesign.com HariesDesign.com HariesDesign.com HariesDesign.com HariesDesign.com HariesDesign.com HariesDesign.com HariesDesign.com HariesDesign.com HariesDesign.com HariesDesign.com HariesDesign.com HariesDesign.com</p> The CSS sets the width and background color of the container object and the color of the text inside. The margins on interior paragraphs are set so that the text doesn’t sit right up against the edge of the box. Then the top and bottom divs are given a background image that contains the right corner images and the left corner images from the HTML code are enabled.
<style> .roundcont {no-repeat top right; no-repeat top right; </style> If all put together. HariesDesign.com HariesDesign.com HariesDesign.com HariesDesign.com HariesDesign.com HariesDesign.com HariesDesign.com HariesDesign.com HariesDesign.com HariesDesign.com HariesDesign.com HariesDesign.com HariesDesign.com HariesDesign.com HariesDesign.com HariesDesign.com HariesDesign.com |
| < Prev | Next > |
|---|



