Blockquotes background

I experimented a new background for all the blockquote tags on the site. The concept is quite simple, but the restrictions are a lot. You need to have the same background color everytime and the blockquote element must have a fixed width.

blockquote {
display: block;
font-size: 8pt;
padding: 5px 46px 5px 9px;
width: 380px;
margin: 22px 0px 22px 15px;
background: #DDF0F5 URL(img/quote.gif) no-repeat;
border-bottom: 1px solid #9CCAD8;
}

This is the code I use for the blockquote element. With a nice background image:

Quote background

Note: the white space you see in the middle is transparency. The white made by the “wicked and worn” effect is “real” white. Result, on a white background:

This is a simple blockquote element.

That is expandable. But not too far.

Because if it goes too far, we’ll lose the background image because we didn’t set it to “repeat”. Although it won’t make a huge difference, because the background is still simple. We’ll just lose the “dirt” effect on the box sides.

Some questions still left though:

  • What if we don’t want to use fixed-width blockquotes?
  • What if we have a 400 lines quotes?
  • What if we have to work with different background colors?

So, you can see it, the technique is not very optimal. But it still works correctly.

There are 5 comments yet. Don't be shy.

1. On March 13th, 2005 at 2:39 am, Joël said :Joël's gravatar

Can’t see why it wouldn’t work with a relative width… can you explain?

2. On March 13th, 2005 at 3:13 pm, Remi said :Remi's gravatar

Yes, quite simple. Because I use a fixed-width background. And I can’t expand the background with CSS. If we’d like to have relative width blockquotes, we’d have to use some nested divs to make two (or four) fixed corners, and another div to make the “repeated” background.

3. On March 13th, 2005 at 5:56 pm, Joël said :Joël's gravatar

Well, I see now - the image I could see was not the one I see now.

4. On March 17th, 2005 at 8:03 pm, Jaz said :Jaz's gravatar

Actually if you use an image for top, one for left and one for right it would work, didn’t you try working with floats?

Cya!

5. On March 17th, 2005 at 8:32 pm, Remi said :Remi's gravatar

How can you assign a top, left and rght background for one (1) element? ;)


Sidebar