Cool CSS Tricks

Flexible box with custom corners and borders

This is a demo of a flexible box with custom corners and custom borders. The box will expand to contain any amount of content vertically, will handle any text size, and can become very wide before the horizontal borders start breaking up. How wide depends on the width of one of the background images.

Two images are used. box.gif is a complete box. For the sake of this demo I’ve made it 1600 pixels wide. It is used for the corners and the horizontal borders. The other image, borders.gif, contains the vertical borders.

Some extra markup is needed to put the corners and borders in place. A bit annoying, yes, but this extra, non-semantic XHTML is quite minimal, and won’t get in the way if CSS is off, so I think I can live with it. It is possible to get rid of some more markup by using the :before and :after pseudo-elements, but since Internet Explorer doesn’t support them I’ll leave the extra markup in there.

The main content area of this box can be filled with any elements you like, as long as their background colour is set to white (or whatever colour the inside of your box has), and their margins are zeroed. If the content is transparent the left border will be doubled because the image used to create it also contains the right border. You can avoid the need for that by splitting the image in two, or adding an extra div to put all your content in. [Johansson]


Johansson, Roger. “Flexible box with custom corners and borders.” 456 Berea Street. 26 June 2004. <www.456bereastreet.com/lab/flexible_custom_corners_borders/> (26 June 2004).

Making tomorrow today

Another bit of inspiration from the album Ovo, by Peter Gabriel as excerpted from the song “Make Tomorrow.”

When it seems hopeless,

make tomorrow today…

What better measure

of what you are doing her

than what you can leave behind.

All the children

of your children’s children,

do you ever think what they’re going to find?

Make tomorrow today.

Food Log

Breakfast was a bowl of cold cereal with banana slices, a glass of orange juice and a cup of coffee. I weighed 158 pounds.

I had a meeting in the Telecommunications Building this morning. The weather was nice, so I walked — about three miles, round trip.

I walked over to the HUB at lunch with some of the guys from the office — also about three miles, round trip — and had Panda Express orange chicken with mixed vegetables on chow mein noodles and a fortune cookie.

A good friendship is often more

important than a passionate romance.

Lucky Numbers 6, 17, 18, 20, 30, 39

Dinner was soy braised chicken, white rice, and two bottles of Saranac Pale Ale.

Workout Log

Tonight’s MBNA Fitness Center workout:

  1. 5 minute warm-up on the treadmill at 4.2 miles-per-hour
  2. 11 repetitions at 125 pounds on the Nautilus Nitro Compound Row
  3. 10 repetitions at 60 pounds on the Nautilus Nitro Overhead Press
  4. 8 repetitions at 75 pounds on the Nautilus Nitro Lateral Raise
  5. 12² repetitions at 125 pounds on the Nautilus Nitro Lower Back
  6. 12¹ repetitions at 90 pounds on the Nautilus Nitro Abdominal
  7. 12¹ repetitions at 55 pounds on the Nautilus Nitro Biceps Curl
  8. 12¹ repetitions at 45 pounds on the Nautilus Nitro Triceps Extension
  9. 12¹ repetitions at 5+1 on the Hoist Prone Leg Curl
  10. 12² repetitions at 100 pounds on the Nautilus Nitro Leg Extension
  11. 12¹ repetitions at 90 pounds on the Nautilus Nitro Super Pullover
  12. 9 repetitions at 135 pounds on the Nautilus Combo Lat Pulldown
  13. 8 repetitions at 70 pounds on the Nautilus Nitro Vertical Chest
  14. 8 repetitions at 65 pounds on the Nautilus Nitro Incline Press
  15. 12² repetitions at 90 pounds on the Nautilus Nitro Seated Dip
  16. 12² repetitions at 105 pounds on the Nautilus Nitro Adductor
  17. 12¹ repetitions at 195 pounds on the Nautilus Nitro Abductor
  18. 11 repetitions at 4+1 on the Hoist Rear Delt
  19. 12² repetitions at 100 pounds on the Nautilus Nitro Pec Fly
  20. 12¹ repetitions at 110 on the Nautilus Nitro Rotary Torso
  21. 5 minute cool-down on the treadmill at 4.2 miles-per-hour

Food Log

Breakfast was a bowl of cold cereal with banana slices, a glass of orange juice and two cups of coffee. I weighed 157 pounds.

At the office I had a cup of green tea.

Lunch was a garden salad with garden salad with Balsamic Vinaigrette, two slices of buttered Italian bread, and a banana, after which I took a four mile walk around campus.

Dinner was some truly awesome lo mein that Gretchen made including some snap peas and green onions from the CSA along with two bottles of Saranac Pale Ale and a bowl of vanilla ice cream with strawberry jam for dessert.

Food Log

Breakfast was three slices of toasted Italian bread with homemade strawberry jam and a cup of coffee. I weighed 155 pounds.

At the office I had another cup of coffee.

Lunch was a garden salad with garden salad with Balsamic Vinaigrette and a banana.

Photograph of Big Hollow road.

I had a 1:00 meeting, so I just took a short walk through the woods north of campus — maybe two or three miles. While I was walking I noticed that the wild black raspberries are doing nicely.

Photograph of unripe wild black raspberries.

During the afternoon I had a PayDay Bar.

When I got home from work, Gretchen was just getting back from working at the CSA, so we sat on the porch and relaxed with a bottle of Saranac Pale Ale.

Since neither of us felt like making anything for dinner, we went out to Applebee’s. We split a cheese quesadilla, then we each had a slab of ribs, fries, beans, and cole slaw. I also had a Bass Ale. The ribs were unremarkable — done, but not falling off the bone, and dry — with nice grill marks, but with a sauce that assaulted the nose. The fries were not as salty as some I have had with ribs, though there was nothing special about them apart from that. The beans and slaw were forgettable. I’ve had better and cheaper, but it didn’t make me sick afterwards, so it has got that much going for it.